Wikipedia talk:Extended image syntax: Difference between revisions

Content deleted Content added
m Archiving 1 discussion(s) to Wikipedia talk:Extended image syntax/Archive 4) (bot
 
(36 intermediate revisions by 20 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
|algo = old(90d)
|counter = 34
|maxarchivesize = 90K
|archiveheader = {{Talk archive navigation}}
|minthreadstoarchive = 1
|minthreadsleft = 14
}}
 
{{Archivebox| auto= yes| search= yes}}
 
== Undocumented: muted and loop options for videos; others? ==
== Coordinates of the thing the image is of ==
 
[[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? ==
Is there syntax for or a way to use coordinates for the thing that the image is an image of? E.g. if you have a picture that is of a particular building in a town, the coords for the article will be for the town. The picture may have coords in its metadata of course, but that’s invisible in any article it’s included in. I ask because a friend in real life recently added a picture and wanted to specify exactly where it was, and I realized I’d never seen this use case before.
 
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:
For example, I took two of the pictures in [[Loch Muick]], and they’re far enough apart to have noticeably different coords. Is there a natural way to add that information to those images in that article? [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 02:02, 13 July 2021 (UTC)
* <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.
:The obvious place for such coordinates would be via {{tl|coord}} in the image's caption. -- [[User:Michael Bednarek|Michael Bednarek]] ([[User talk:Michael Bednarek|talk]]) 03:22, 13 July 2021 (UTC)
* <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.
::I tried this with <nowiki>{{Coord| 56.851082| -3.741822|display=inline|name=Dail-an-eas bridge}}</nowiki> in the fourth image in [[Glen Tilt]]. (The documentation for {{tl|Coord}} made me think it was only for the main article ___location.) It works, but it doesn't look as if anyone ever expected coord to be used this way -- the "name" parameter does nothing in the article, and in the linked GeoHack page it does use it as the (easily missed) page title, but also gives it as the article name in the link back to Wikipedia. It would be nice if the image syntax allowed something prettier to be automatic. For example the [[Glen Tilt]] page itself has "[[Geographic coordinate system|Coordinates:]] [[File:WMA button2b.svg|inline|17x17px]] {{Coord|56.833|N|3.776|W}}" at the top right, with tooltip text for the button saying "Show ___location on an interactive map". Can something like that be made to happen when a coord is used in an image caption? Perhaps using the name parameter to make it "Show Dail-an-eas bridge on an interactive map" for the tooltip? [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 05:34, 13 July 2021 (UTC)
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)
:A facility for image coordinates already exists, although not in the form you want. See "Camera ___location" in the "Summary" section of the file description page for [[:File:University of Oklahoma Observatory in 2018.jpg|this image]]. We could debate the merits of making it more visible/accessible, but in my opinion it would be a bad idea for multiple reasons. It would be unwise to allow the same information in both places, with no mechanism to ensure that they are in agreement. The information in the file description is for readers as well as editors, and it would not serve readers in the long term to protect them from having to learn to use it. My suggestion is to update the file description with the coordinates, revert your change to the caption, and call it a day. [[Special:Contributions/68.97.42.64|68.97.42.64]] ([[User talk:68.97.42.64|talk]]) 06:21, 13 July 2021 (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)
::The popup for [[Meta:WikiMiniAtlas|WikiMiniAtlas]] is obscured if {{tlf|coord}} appears in the last line of an image caption. This can be avoided by using it earlier in the caption, or by adding 2 line breaks after it. -- [[User:Michael Bednarek|Michael Bednarek]] ([[User talk:Michael Bednarek|talk]]) 11:05, 13 July 2021 (UTC)
:::I see what you mean; I added a couple of line breaks and the WikiMiniAtlas popup is now visible. It sounds like that's the best current answer. I take the IP's point about the image file being the natural places for the coordinates to live, but that shouldn't prevent useful reader functionality -- a template that was able to extract the coords from the image file and display a WikiMiniAtlas link would be a nice gadget to place inside a caption. I'll suggest that at [[WP:VPT|VPT]]. [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 12:35, 13 July 2021 (UTC)
::::I'm with 68.97.42.64 on this. Commons provides a number of templates specifically for this, which are used on file description pages - they include [[c:Template:Globe ___location]], [[c:Template:Location]] and [[c:Template:Object ___location]]. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 15:55, 13 July 2021 (UTC)
:::::Thanks for the links; those look like what I was looking for. [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 09:25, 15 July 2021 (UTC)
::::::{{ping|Mike Christie}} {{tq|those look like what I was looking for.}} That seems unlikely, since they can't be used in image captions. They are for use in the file description like the example I gave above. {{tq|that shouldn't prevent useful reader functionality}} Said functionality is in the file description, provided editors don't go out of their way to prevent readers from learning to use it. Your solution would tend to undermine the intent of the file description, both for coordinates and for all of the other useful information there. Curious and resourceful users of any software poke around for things that might be useful to them, rather than assuming that everything that might be of use is placed in front of them with no effort on their parts. Those users will always be more productive, and that's just a fact of life. Again, it doesn't serve the lazy users to keep them lazy, and in my opinion those users are becoming less common with each new generation. This is from a person who had a long career working with the human-computer interface. You're free to disagree with my philosophy on this, but I wanted to be sure you understand it. The file description is intended to be used. [[Special:Contributions/68.97.42.64|68.97.42.64]] ([[User talk:68.97.42.64|talk]]) 20:11, 15 July 2021 (UTC)
:::::::Well, there are two people looking for an answer here; my friend, who does want to put locations in captions, and for whom this is probably not the answer they were hoping for, and me. I think my friend's wish to display locations in captions is a reasonable opinion, though I don't find it useful myself, but I understand your point about storing the data in only one ___location and I think that if locations are ever to be displayed in captions it would be best to have it extracted from the underlying file. That's why I said Redrose64's answer was what I was looking for. [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 20:17, 15 July 2021 (UTC)
::::::::You seem to equate the file description to Wikidata; i.e. a data repository not to be used directly by readers. I think that's the crux of our disagreement. [[Special:Contributions/68.97.42.64|68.97.42.64]] ([[User talk:68.97.42.64|talk]]) 20:33, 15 July 2021 (UTC)
:::::::::I was under the impression that one of the reasons to store data in {{tl|Coord}} was that it was machine readable -- in fact the template documentation says as much. And you're right that I am assuming that it would be OK to programme something to read it. I can see that wikidata might want to take that data, and that any programmatic access might pull from there instead, but are you saying that it is actually undesirable to read the commons coord data via template coding, for some display purpose or other? I would think that would suffer from the same criticism as above: reading a copy of the data is less desirable than reading the source. Or are you saying that wikidata should be treated as the source here? [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 20:50, 15 July 2021 (UTC)
::::::::::I'm saying that the coordinates should appear only in the file description, where the more resourceful users will find it, remember that they found it, and go whenever they want image coordinates. For those who don't want image coordinates, who I believe comprise a large majority, placing them in the caption creates visual clutter that detracts from the article. And, as I've said, it reduces the likelihood that a reader will ever discover the file description and the useful information often found in the "Description" and "Date" fields, for example. By your reasoning, we should have a way to pull those items from the file description and show them in the caption because some readers will find them informative; all to accommodate readers who lack the motivation to click through to the file description and investigate what's there. That's bad design in my opinion. [[Special:Contributions/68.97.42.64|68.97.42.64]] ([[User talk:68.97.42.64|talk]]) 21:16, 15 July 2021 (UTC)
:::::::::::Then we do have a difference of opinion. I agree that it is good for readers to discover the file description, for the reasons you give, and like you I don’t see much value in adding coordinates to captions. But I don’t think we should legislate that data should not appear in one place because it would be better for the user to have to go to another place to see it. How the data should be presented is a design decision that I feel we should leave to the editor working on each instance. [[User:Mike Christie|Mike Christie]] ([[User_talk:Mike Christie|talk]] - [[Special:Contributions/Mike_Christie|contribs]] - [[User:Mike Christie/Reference library|library]]) 21:37, 15 July 2021 (UTC)
::::::::::::It's already legislated - [[MOS:CAPTION]] says {{tq|Captions should be succinct; more information can be included on its description page, or in the main text.}} So we put coords on the file description page, not in the caption. --[[User:Redrose64|<span style="color:#a80000; background:#ffeeee; text-decoration:inherit">Red</span>rose64]] &#x1f339; ([[User talk:Redrose64|talk]]) 22:08, 15 July 2021 (UTC)
 
== Specifying image dimensions for OpenGraph metadata ==
== Copiable text vs mouse-over text ==
 
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.
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?
 
Off the top of my head, I can imagine a few ways of fixing this:
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, display as a blank box. The alt parameter will provide a distinct mouse-over text:
 
# 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
:<nowiki>[[file:....svg|16px|(mouseover text)|alt=(copiable text)]]</nowiki>
# <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)
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')]].
 
== Centre a caption? ==
Note that the mouse-over display is the description of the symbol, while if you copy the text and paste it in another document, you'll faithfully reproduce the Wikipedia text "Source of information: 🛈." (You may need to install a supporting font for the Unicode character '🛈' to display.)}}
 
PleaseIs pingthere mea ifway youto respondcentre align (or centre justify) a caption below an image? [[User:KwamikagamiSpideog|kwamiSpideog]] ([[User talk:KwamikagamiSpideog|talk]]) 0014:0848, 15 JanuaryJune 20222025 (UTC)