Wikipedia talk:Extended image syntax: Difference between revisions

Content deleted Content added
em sizes: new section
m Archiving 1 discussion(s) to Wikipedia talk:Extended image syntax/Archive 4) (bot
 
(27 intermediate revisions by 15 users not shown)
Line 1:
{{talkheader| search= yes}}
{{WikiProject Helpbanner shell|class=NA|importance=low}}
{{Wikipedia Help Project|class=NA|importance=low}}
}}
{{User:MiszaBot/config
|archive = Wikipedia talk:Extended image syntax/Archive %(counter)d
Line 13 ⟶ 15:
{{Archivebox| auto= yes| search= yes}}
 
== Undocumented: muted and loop options for videos; others? ==
== Copiable text vs mouse-over text ==
 
[[File:Mengerzugendlossequenz 2880p60 20200226 color CRF04.webm|thumb|loop|A <code>loop</code> video]]
[[File:Cat piano with audio 3EB0CD1F.webm|thumb|muted|A <code>muted</code> video]]
[https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/816208/1 A couple of years ago], the <code>loop</code> and <code>muted</code> keywords were added to codebase. Examples to the right.
 
These are not documented. Which makes me wonder, if there are other important undocumented options...
 
Should I go ahead and add these to the page?
--[[User:Nanite|Nanite]] ([[User talk:Nanite|talk]]) 17:15, 26 February 2024 (UTC)
 
:They are documented: [[mediawikiwiki:Extension:TimedMediaHandler#Syntax_synopsis]] —[[User:TheDJ|Th<span style="color: green">e</span>DJ]] ([[User talk:TheDJ|talk]] • [[Special:Contributions/TheDJ|contribs]]) 19:25, 14 April 2024 (UTC)
::{{ping|TheDJ}} ah sorry I missed your reply. I mean to suggest they should be documented on this page. --[[User:Nanite|Nanite]] ([[User talk:Nanite|talk]]) 22:56, 17 March 2025 (UTC)
 
== How to ''link'' to a specific DjVu/PDF page? ==
 
The {{para|page}} parameter allows selecting a specific page in a DjVu/PDF file when ''displaying'' an image (example: <code><nowiki>[[File:Alice in Wonderland.djvu|thumb|page=5|Page 5 from ...]]</nowiki></code>). However, this does not work for ''linking'' to a specific page:
Sometimes we need to substitute Unicode characters with images due to lack of widespread font support. Because a user manually copying the WP text should still get the correct character, the Unicode character is often added to the file syntax after a pipe. But that causes it to display as the mouse-over as well, which isn't useful (the mouse-over is either equivalent to the image, or displays as an empty box or question mark). I was thinking of adding the following text to our instructions to resolve the issue. But would this cause different problems with screen readers? Will a screen-reader recognize what a Unicode character is even if the user doesn't have the fonts to display it?
* <code><nowiki>[[:File:Alice in Wonderland.djvu|page=5|p.&amp;nbsp;5]]</nowiki></code> gives "[[:File:Alice in Wonderland.djvu|page=5|p.&nbsp;5]]" with a wrong text and a link to the whole file instead of its specific page.
* <code><nowiki>[[:File:Alice in Wonderland.djvu?page=5|p.&amp;nbsp;5]]</nowiki></code> gives "[[:File:Alice in Wonderland.djvu?page=5|p.&nbsp;5]]" with correct text but a wrong link with [[percent-encoding|percent-encoded]] <code>?</code> symbol.
Is there a valid wiki syntax or a helper template to achieve this without using an "external link" (<code><nowiki>[https://en.wikipedia.org/wiki/File:Alice_in_Wonderland.djvu?page=5 p.&amp;nbsp;5]</nowiki></code>)? — [[User:Mikhail Ryazanov|Mikhail Ryazanov]] ([[User talk:Mikhail Ryazanov|talk]]) 21:50, 17 March 2025 (UTC)
: Found the template myself (accidentally): {{tlx|PDF page link|file{{=}}Alice in Wonderland.djvu|page{{=}}5|text{{=}}p.&amp;nbsp;5}} gives "{{PDF page link|file=Alice in Wonderland.djvu|page=5|text=p.&nbsp;5}}". No wiki syntax apparently exists. — [[User:Mikhail Ryazanov|Mikhail Ryazanov]] ([[User talk:Mikhail Ryazanov|talk]]) 02:52, 24 March 2025 (UTC)
 
== Specifying image dimensions for OpenGraph metadata ==
Suggested text:
{{blockquote|The alt text is what gets copied when a reader manually copies a section of Wikipedia text that includes images. This may be useful when an image is used to substitute for a Unicode character that may not yet have widespread font support. The mouse-over, however, should be something more descriptive, as it would be unhelpful for it to look just like the image or, worse, to display as a blank box. The alt parameter provides for this distinction:
 
The article on [[Kat Abughazaleh]] has an image, [[commons:File:Kat_Abughazaleh_2_(portrait_cropped).jpg|a portrait photo of the subject]] that a contributor cropped from [[commons:File:Kat_Abughazaleh_2.jpg|a larger photo]], in the infobox. When social media sites extract metadata from that page via OpenGraph and prefer a landscape-oriented image ([https://bsky.app/profile/spm1961.bsky.social/post/3lolwbe7qbc2m example]), the default dimensions/crop are sometimes pretty suboptimal, displaying the person's nose and mouth but truncating the eyes.
:<nowiki>[[file:....svg|16px|(mouseover text)|alt=(copiable text)]]</nowiki>
 
Off the top of my head, I can imagine a few ways of fixing this:
For example,
:<nowiki>Information: [[file:Infobox info icon.svg|16px|alt=&amp;#x1F6C8;|The 'information' icon (circled 'i')]].</nowiki>
will display as:
:Information: [[file:Infobox info icon.svg|16px|alt=&#x1F6C8;|The 'information' icon (circled 'i')]].
 
# Include two images on the page; use <code>class=pageimage</code> and <code>class=notpageimage</code> to override the [[mediawikiwiki:Extension:PageImages|Page Images]] selection criteria so that one goes into the social media preview and the other is actually displayed to those who visit the page
Note that the mouse-over display is a description of the symbol, while if you copy the text and paste it in another document, you'll faithfully reproduce the intended text "Information: 🛈." (You may need to install a supporting font for the Unicode character '🛈' to display.)}}
# <nowiki>replace the current image with the prior uncropped image, use {{</nowiki>[[Template:CSS image crop|CSS image crop]]<nowiki>}} or {{</nowiki>[[Template:Annotated image|Annotated image]]<nowiki>}} to crop it appropriately for portrait display in the infobox, so that the re-cropping by OpenGraph has more to work with</nowiki>
 
I welcome advice! [[User:Sumanah|Sumana Harihareswara]] 15:24, 13 May 2025 (UTC)
Hopefully, a screen-reader would handle the Unicode character better than we would with our verbal description. But if that won't work, would it be possible to add a 'character' param to the file syntax that would enable faithful copying of the intended WP text without interfering with screen-readers or mouse-over texts? Please ping me if you respond — [[User:Kwamikagami|kwami]] ([[User talk:Kwamikagami|talk]]) 00:08, 1 January 2022 (UTC)
 
== emCentre sizesa caption? ==
 
Is there a way to centre align (or centre justify) a caption below an image? [[User:Spideog|Spideog]] ([[User talk:Spideog|talk]]) 14:48, 5 June 2025 (UTC)
I think em sizes should be perfectly possible to support by now. Just have a bit JavaScript fix up the src-attributes if it turns out the initial guess was incorrect. [[Special:Contributions/92.67.227.181|92.67.227.181]] ([[User talk:92.67.227.181|talk]]) 16:31, 18 July 2022 (UTC)