Wikipedia talk:Extended image syntax

From Wikipedia, the free encyclopedia
Jump to: navigation, search
the Wikipedia Help Project  
WikiProject icon This page is within the scope of the Wikipedia Help Project, a collaborative effort to improve Wikipedia's help documentation for readers and contributors. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks. To browse help related resources see the help menu or help directory. Or ask for help on your talk page and a volunteer will visit you there.
 ???  This page does not require a rating on the project's quality scale.
 ???  This page has not yet received a rating on the project's importance scale.
 

Caption and alt text[edit]

“Unfortunately, it is not possible to specify different text for these two purposes.”

This seems to be out of date. Near as I can tell, an image gets a blank alt="" by default, but you can add an alt=xxx parameter. But the caption serves as alt text when it is not shown, but then if both are specified the alt overrides the caption. Is this correct? Michael Z. 2008-12-08 00:23 z

The "alt=" option is fairly new. I have attempted to document it now, but I am not sure that I got the details right. —AlanBarrett (talk) 21:38, 2 February 2009 (UTC)

Other units besides PX?[edit]

Some images (such as those generated by the {{music}} template) use images as a substitute for characters. In these cases it is more optimal to use size units that are tied to a given font type, such as EM or EX. I'd like to suggest that these units be supported aas well. Thanks. SharkD (talk) 20:05, 2 January 2009 (UTC)

Try asking for a new feature at bugzilla:. This page is concerned only with documenting existing features. —AlanBarrett (talk) 22:24, 2 February 2009 (UTC)


Putting caption text on side of image?[edit]

Is this possible? I'd like the text to appear on the left or the right of an image, rather than underneath it. Can anyone tell me how that is possible or if it is? Wikidea 15:34, 2 February 2009 (UTC)

You could create a table in which the image is on one cell and the text of your chouce is in another cell. But it wouldn't be a caption. —AlanBarrett (talk) 22:28, 2 February 2009 (UTC)

image as background[edit]

It is possible that I missed it, but is it possible for text to overlap an image, like the image is a background? Buɡboy52.4 (talk) 02:31, 8 March 2009 (UTC)

Link[edit]

Link works here, but it doesn't work on my mediawiki at work. Does anyone know what extensions or release incorporated this feature?

[[Image:Westminstpalace.jpg|200px|caption text|link=Westminster Abbey]]

Thanks. -Legaia (talk) 19:22, 1 May 2009 (UTC)

IIRC, it was introduced in version 1.14 --Michael Daly (talk) 02:31, 1 July 2009 (UTC)

Positioning[edit]

Why does this version of the article Autobahn show the image of the Swiss network in IE8 (in strict mode) below the section "Speed limits", and in Firefox 3.0.4 also below that section, but overlaying the text of that section? IE7 shows that image as intended below the section "Current density/Switzerland" to the left of the text of that section, as does IE8 in Compatibility View. Michael Bednarek (talk) 05:23, 8 May 2009 (UTC)

disambig for Wikipedia and commons images with same file names[edit]

Is there a way to force an image to point to the commons, when images exist with identical names on both Wikipedia and Commons. http://en.wikipedia.org/wiki/File:Mission_Dolores.jpg and http://commons.wikimedia.org/wiki/File:Mission_Dolores.jpg I would like to point to the commons version, but when I do, I get the wikipedia version. SaltyBoatr (talk) 16:05, 18 August 2009 (UTC)

I don't know of any way to do that within the image syntax. The usual way to fix this problem is to rename one of the images. You can request that one (presumably the English Wikipedia one) be renamed. Eubulides (talk) 15:49, 19 August 2009 (UTC)

Images Aligned Left & Numbered List text[edit]

Hi, I have tried to align an image left and to put it in front of a numbered listed.

Qwan Ki Do See here in the Code of honour section

Unfortunately the Numbers of the list appear in the picture... Is there a way to correct that?

Thanks Fsjmax (talk) 14:14, 20 October 2009 (UTC)

It clearly seems to be a bug. However, there are several workarounds (apart from positioning the image to the right). One is to construct a simple table which allows more control; I have left my attempt on that page – feel free to revert. -- Michael Bednarek (talk) 14:55, 20 October 2009 (UTC)
Thanks a lot. It looks a lot better. Cheers Fsjmax (talk) 17:23, 20 October 2009 (UTC)
Applying a workaround is one thing, getting the bug fixed is another. For the benefit of those who want to investigate it, here is the link to the page in question when it exhibited the faulty behaviour: "Qwan Ki Do" on 19 October 2009 06:34. -- Michael Bednarek (talk) 14:23, 21 October 2009 (UTC)

Sound file linking[edit]

Is there an equivalent of this page for sound files? -- œ 02:06, 2 November 2009 (UTC)

Sorry, not that I know of. Eubulides (talk) 03:27, 2 November 2009 (UTC)
Hmm, Perhaps there should be? -- œ 11:18, 8 November 2009 (UTC)
I think so, too. I've started a draft at User:Michael Bednarek/SandBox#Wikipedia:Extended image syntax. It's all trial and error, and I have now found the virtual namespace Media: which seems to behave differently from the File: namespace. In the meantime, may be that draft provides an answer to your immediate problem, or you could raise it here. -- Michael Bednarek (talk) 13:54, 8 November 2009 (UTC)

0.75, not 0.78[edit]

A recent edit changed "0.75" to "0.78" with the comment "It's not 80% and it's not 75%... it calculates out to 77.777777777777777% or 78%". This calculation is incorrect. What Mediawiki does is take the default thumbnail size (typically 180px), multiply it by 0.75, and then round to the nearest 10. Since 180 × 0.75 is 135, this rounds to 140. Now, it's true that 140/180 is 0.777..., but the actual factor is 0.75, not 0.777.... You can verify this by setting the default thumbnail width to 200px. If you do that, the upright image will be 150px (200 × 0.75), not 160px (200 × 0.777..., rounded to the nearest 10). I've also verified this by reading the Mediawiki source code. I fixed the project page to make this clearer. Eubulides (talk) 06:08, 12 November 2009 (UTC)

Thanks for the investigation and clarification! Binksternet (talk) 13:01, 12 November 2009 (UTC)

problems converting {{click}} to new syntax[edit]

I've noticed that certain images don't seem to display correctly when I convert the deprecated {{click}} to the new format. In other words, some images become slightly larger than with the {{click}} template, even though I'm using the same parameters. Does anyone know why this might be happening? --Ixfd64 (talk) 18:42, 12 November 2009 (UTC)

Could you please give a specific example? Eubulides (talk) 21:13, 12 November 2009 (UTC)
It seems to happen with certain images. I've provided an example below:

{{click|link=Wikipedia:Administrators|image=Goldenwiki.png|width=20|height=20|title=Example text.}}

produces

Example text.

while

[[file:Goldenwiki.png|link=Wikipedia:Administrators|20px|20px|title=Example text.]]

produces

title=Example text.

As you can see, the lower image is slightly larger. --Ixfd64 (talk) 07:20, 13 November 2009 (UTC)
The lower image isn't using the correct syntax. You want this:
[[file:Goldenwiki.png|link=Wikipedia:Administrators|20x20px|Wikipedia administrators]]
which produces an image Wikipedia administrators that is the size you want and does not generate an unwanted "title=" in the tooltip or alt text. Eubulides (talk) 08:08, 13 November 2009 (UTC)
I see. Thanks for clearing this up! --Ixfd64 (talk) 18:18, 13 November 2009 (UTC)

Orientation glitch[edit]

Mcdonalds stratford.jpg
Mcdonalds stratford.jpg

Here is an image which refuses to orient correctly unless the width is over 120px. A picture like this can't therefore be used in a gallery. Is the anomaly a function of width:height ratio? Can it be rectified by inserting additional code? It's occurred with only one of the pics in my gallery of contributions. Cheers Bjenks (talk) 20:08, 20 November 2009 (UTC)

There was something funky about File:Mcdonalds stratford.jpg. Whatever process was used to rotate it, lost information. I suspect that the rotation procedure created a JPEG image that the Wikimedia software can't grok. Anyway, I installed a version of that image that was rotated without losing info (I used jpegtran), in an attempt to fix the problem. Please feel free to revert if you don't like the result. Your gallery looks OK now, at least to me; but interestingly enough it's not working in this talk page for me right now (a caching problem perhaps?). If the problem persists, I suggest taking it up at Wikipedia:Village pump (technical). Eubulides (talk) 22:44, 20 November 2009 (UTC)
This talk page also looks good to me now, so it was just a temporary caching problem after all. Hope you like the results. Eubulides (talk) 22:45, 20 November 2009 (UTC)
I dips me lid, great guru of daguerreotypic digitalis. The science of such rotation is far beyond my ken. :) Cheers Bjenks (talk) 03:03, 21 November 2009 (UTC)

Needs move to "Extended file syntax"[edit]

It is incorrect for this to be called extended "image" syntax, because in the past year or so it seems the developers decided to do away with the use of Image: and Sound: and Video: and now have replaced all three with the generic File:

And besides this document already includes sections on video and sounds so it isn't about just images (anymore). Need to update the article name to match the current situation. This would then become a legacy redirect to the new article name.

But this article is protected, so as a normal user I cannot do this. DMahalko (talk) 19:02, 9 January 2010 (UTC)

Placement of text[edit]

Example
(left caption)
Example.jpg Test.png Test
(right caption)

Is there any way to place the caption text to the left or the right of the image? I can't find anything on it. Tom Reedy (talk) 20:41, 15 January 2010 (UTC)

It's possible, but I don't understand why anyone would do that. -- Michael Bednarek (talk) 07:59, 16 January 2010 (UTC)
Thanks. I want to stack several images of different sizes and I want to place the text to the left of the more narrow ones. Tom Reedy (talk) 20:35, 16 January 2010 (UTC)

Stacking multiple images[edit]

I want to stack multiple images. They are different widths and I want them to line up to the left side. Is there any way to do that? Tom Reedy (talk) 00:05, 16 February 2010 (UTC)

Problem with mouseover text when linking[edit]

Hi! I need help with changing the text that displays during mouseover when using |link= . I'm new to Wikipedia, but I've been editing a certain browser game's official Wiki for few months. I've now encountered a this problem which is beyond my skills and I hope to find a solution here. So basically, I've created a navigation template for pages on my user namespace. On the template I have used a small image which I have linked to a page, but now the text that appears when I bring my mouse over it is the name of the page and not the one I'd like to be displayed. Is there any way to change this, like using span title or something similar? Here's the template's code if it helps. The file link is right after <div style> tag. Of course I could just lose the link and solve the problem, but I'm also curious if this even can be done.

I've tried pretty much everything, I even made an image map but it stretched the borders of the box so I decided not to use it. I have tried using <span title=""> inside and around the file link and I tried using {{!}} just in case. And just to make sure, it's not a caption I'm trying to make here, I just want a similar effect like when using span title. If the text is not even possible to be changed when linking, I'd like to know that too. ;) I hope you got what I'm trying to ask. Thank you in advance! --Kuhafile (talk) 22:27, 5 March 2010 (UTC)

See WP:PIC#Plain pictures. For example, "[[File:Example.svg|x20px|link=Main page|alt=just another example|Woo hoo!]]" produces an image just another example that says "Woo hoo!" when you mouse over it. Eubulides (talk) 23:31, 5 March 2010 (UTC)
That was the very first thing I tried but it didn't work so I figured there must be some different trick to it. But the problem seems to be in our wiki engine, maybe it lacks an extension or something. So there's nothing I can do. Thank you anyway! --Kuhafile (talk) 08:42, 6 March 2010 (UTC)

Animated GIF Thumbs[edit]

Thumbnailing an animated GIF does not result in an error, so there is no warning, but the animated GIF is not processed. Instead the original animated GIF is shipped, and whether the animated GIF is subsequently scaled to fit the allotted space is down to the capabilities of the receiving browser.

This is not true. The Spinning Dancer uses a very inefficient auto-generated thumbnail that is more than 4x the size of the original file. —Preceding unsigned comment added by 96.61.90.239 (talk) 06:26, 18 May 2010 (UTC)

I note commons:Category:Animated gifs exceeding the 12.5MP limit seems to explain when animated GIFs work. Mark Hurd (talk) 17:56, 11 September 2011 (UTC)

caption placing[edit]

Is there a way to put the caption above the image instead of below? I need it for a special case.--Zereshk (talk) 22:01, 15 July 2010 (UTC)

(caption)
Example.jpg
Not directly, but one can construct a table to suit:
{| align=right
|(caption)
|-
|[[File:Example.jpg|90px]]
|}
Michael Bednarek (talk) 11:56, 16 July 2010 (UTC)

Copy edits[edit]

  • The line:

The empty string, if there an explicitly requested Caption and the image type has a visible caption.

is missing an "is" between there and an.

  • Also, in the sentence:

...and examples 2 and 3 provide no navigatable links to the files themselves...

"navigatable" is not a word; the correct word is navigable. (Wiktionary does include navigatable, defining it in a strictly web-related sense; however, I could find no other [free] online dictionary—and I was thorough, checking the free dictionaries at www.merriam-webster.com, www.oxforddictionaries.com, dictionary.cambridge.org, www.thefreedictionary.com, and dictionary.com (alias dictionary.reference.com)—that included navigatable; they all included navigable.)

I can't make these edits because the page is protected (so I'm noting the errors here, the next best thing). 141.158.233.114 (talk) 00:30, 25 July 2010 (UTC)

Someone has applied your suggestions, cheers! Lee∴V (talkcontribs) 09:44, 5 August 2010 (UTC)

Re-sizing (with 'px') did not work.[edit]

I have been struggling to re-size images with the 'px' parameter. Only recently discovered that (surprise!) 'frame' disables re-sizing. Which is mentioned under 'frame', but not in the discussion of re-sizing. How about mentioning this under 'px' (the feature it disables)? - J. Johnson (JJ) (talk) 22:12, 4 August 2010 (UTC)

added note in lead and 'size' section - good enough ? Lee∴V (talkcontribs) 09:43, 5 August 2010 (UTC)
That should work. Thanks - J. Johnson (JJ) (talk) 20:21, 12 August 2010 (UTC)

Rotation[edit]

No means to rotate by 90, 180 or 270 degrees? JMK (talk) 08:48, 8 October 2010 (UTC)

I see in the archives this was requested before. Would be useful if someone can get this to work. JMK (talk) 08:50, 8 October 2010 (UTC)

File feature request - Defaulting to image description in Commons[edit]

It would be very cool and helpful if the File syntax could default the caption (using some parameters/flags) to the image descriptions as defined in commons:Template:Information description field (optionally selecting English description automatically or allowing the user to chose the language). Without this feature, I find adding image descriptions/captions via pipes tedious and in some cases very redundant. Of course, this is for the case where the images are in Commons and use that template, which in the case of Wikipedia are a lot --Codrin.B (talk) 22:14, 23 January 2011 (UTC)

This is an interesting automation idea. It's true that too many images end up without captions, or wrong captions. However, the "magically appearing" text might be confusing to editors, and might prompt them to edit the description at WP or Commons, which would be wrong... Adequate documentation could help, but still, I have my doubts. --Lexein (talk) 02:50, 21 May 2011 (UTC)

linking thumbnail to full resolution image?[edit]

What is the recommended way of creating thumbnails that link directly to the full size image, as opposed to the image description page? Since "thumb" and "link" can't both be defined, I'm guessing someone knows of a good alternative. — Preceding unsigned comment added by Oayfer (talkcontribs) 18:02, 19 April 2011 (UTC)

Feature request: "title=" parameter[edit]

Alt text is not universally displayed by default in all browsers (example: Chrome). But Title text seems to be. Additional image "mouseover" information would improve the reader experience. In the simplest case, if the alt= text is copied to title=, then all readers could see the extended description offered to vision impaired readers. If there's a better place to discuss this, please say so... --Lexein (talk) 02:55, 21 May 2011 (UTC)

Feature request: Cropping[edit]

Would it be possible to add on-the-fly cropping functionality to images? At the moment you can use {{Css Image Crop}}, but it doesn't let you float the image and it's incompatible with {{Infobox}}. I'd like to place this image in the infobox at William Ellis (missionary) please: nagualdesign (talk) 21:41, 4 December 2011 (UTC)

William Ellis, missionary from the Society and Sandwich Islands, by Charles Taylor, 1827.jpg
This will require a software update; see WP:BUG. ---— Gadget850 (Ed) talk 23:55, 4 December 2011 (UTC)
It seems to me that image floating is supported by {{Css Image Crop}}.
{{Css Image Crop
|Image         = The Name of the image.
|bSize         = The Base Image size (the image we are cropping on) 
|cWidth        = Crop Image Width in pixels
|cHeight       = Crop image Height in pixels
|oTop          = Offset Top in pixels
|oLeft         = Offset Left in pixels
|Location      = 'right', 'left', 'center' or 'none'. Determines placement of the image on the page.
                 Defaults to 'right' when description is provided (as is default for thumb images).
                 When description is blank, location on left (as is default for non-thumbs).
|Description   = Description (will render out using thumbnail class) 
}}
It is however possible that I am not paying attention. fredgandt 00:05, 5 December 2011 (UTC)
Yes, it does seem to float against text (although it doesn't seem to like the <pre> box above). Not sure why I couldn't get it to work before. Anyhow, it's still incompatible with {{Infobox}}, passing excess wikimarkup from {{Css Image Crop}} as it does. Would it be better to simply create a derivative (cropped) image in a new file, or is what I'm trying to achieve useful? nagualdesign (talk) 00:23, 5 December 2011 (UTC)

Size specification and caption incompatible?[edit]

Am I understanding correctly that the caption attribute will not work in these cases?:

  1. when the image size is specified
  2. when the "frame" attribute is not invoked?

That is, must there be a frame for the caption to display? I can see why this might be required. But I don't get why I can't both specify a pixel width and have a caption. Can someone please clue me in? Thanks in advance. Eric talk 00:46, 14 March 2012 (UTC)

This has 100px and frame
This has 100px and thumb
Specifying a size doesn't affect whether a caption will show or not. For displaying a caption, the essential item is either frame or thumb. The difference between these are that frame ignores the size parameter: it will always display at the image's "natural" maximum size (this is shown on the file description page: for the image at right, the file description page shows "173 × 21 pixels" so it's 173px wide); whereas thumb respects the size parameter, and if omitted it will use the default size for thumbnail images (220px) or the "natural" maximum size, whichever is smaller. --Redrose64 (talk) 12:53, 14 March 2012 (UTC)
Thanks for the clarification, Rr! So, if you have a minute and are curious, would you mind telling me if you see a cleaner way to put a "caption" under the frameless image here?: User:Eric --Eric talk 16:51, 14 March 2012 (UTC)
You've probably noticed that articles with infoboxes often have a caption under the infobox image, but the image isn't framed; for example, Reading Southern railway station. The infobox disguises the technique, but it's essentially the same as the method that you've used: there is a table, and the image and caption occupy the full width of two consecutive rows. I don't know of another way of doing it, unless two or more images are shown next to each other - for example at User:Redrose64#About me where there is a {{multiple image}}. --Redrose64 (talk) 18:59, 14 March 2012 (UTC)
Ok, thanks again! Eric talk 21:32, 14 March 2012 (UTC)

Horizontal alignment to right of column[edit]

What I have is a page with a fairly long infobox down the right hand side. I'd like to mix text and pictures in the left hand space. It's OK floating left, because left of column is left of page, but floating right puts the image below the infobox rather than to the immediate left of it. Is there any way round, or do I live with it? Johnmperry (talk) 06:51, 17 November 2012 (UTC)

I've never seen a right-floated image to the left of an infobox, only below, so I guess that's the way it always behaves. --Redrose64 (talk) 09:42, 17 November 2012 (UTC)
Example.jpg
Jimbo Wales
147 GD-Preis 5280.jpg
Wales in January 2011
Born (1966-08-07) August 7, 1966 (age 48)
It can be done with a right-aligned table, but that has several drawbacks. For one, the white space is not properly filled with text because the table forms a rectangle the size of the combined objects. In this example, if Jimbo's infobox were it's real size, there would be considerable white space to its left below the example image. You can see this effect by sharply reducing the width of your browser window when viewing this page. Generally (and trivially) speaking, if there is not enough room in an article to accommodate many images, the article's text need to be expanded or images removed. Sometimes a gallery can help, but mostly a surfeit of images doesn't improve an article's encyclopedic value. -- Michael Bednarek (talk) 12:20, 17 November 2012 (UTC)


We at WV are working on a main page redesign[edit]

The primary proposal is here [1]. The difficulty is that we need the image to stay on the page at different screen sizes. Anyway to do this? Doc James (talk · contribs · email) (if I write on your page reply on mine) 09:05, 23 January 2013 (UTC)

Changing an image in the same box / frame[edit]

Is there discussion elsewhere on the following please, or syntax I can use to change the image in a box on the same page by selecting two or three links / buttons? For example I'm working on a Portal for the new Welsh Coast Path [here], which has a map of all 8 sub paths. I think it would be wonderful if a second map could be loaded and viewed instead of this one, showing the towns along the path; you can see the link is there, but alas, it opens a whole new window rather than replacing the Paths image with the towns image. All images would be the same size, of course. Any suggestions or pointers please? Feel free to edit on my namespace, should you wish to experiment or correct! Llywelyn2000 (talk) 13:37, 9 May 2013 (UTC)

Semi-protected edit request on 11 October 2014: Clean up syntax statement to make more readable[edit]

I suggest changing the syntax statement at the very beginning of the article from this:

[[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|Caption]]

To this:

[[File:Name|Type|Border|Location|Alignment|Size|link=Link|alt=Alt|Caption]]

It would make it a lot more readable and understandable. Bolded+Italicized would indicate that you substitute strings into those positions, while regular font means you put down what you see.

Hope you understand. BlueFenixReborn (talk) 07:11, 11 October 2014 (UTC)

Yes check.svg Done EoRdE6 (talk) 18:38, 11 October 2014 (UTC)

Parameter «lang=» not described[edit]

Please, add description of lang= parameter. Usage example:

[[File:name.svg|lang=fr]].

SVG file may contain following code:

<switch>
   <text x="0" y="0" systemLanguage="en"> English text </text>
   <text x="0" y="0" systemLanguage="fr"> French text </text>
</switch>

This is supported by rsvg and can be used to localisation. 94.180.44.12 (talk) — Preceding undated comment added 15:15, 24 April 2015 (UTC)

No language specified
|lang=en
|lang=fr
This has been possible for a couple of years now (examples at right). But this is the English Wikipedia: are we likely to want to display such images using non-English text? --Redrose64 (talk) 16:11, 24 April 2015 (UTC)

px guidance discrepancy[edit]

WP:IMGSIZE, part of a policy page, strongly discourages the use of px for thumbnails. This is for very good reason, as px defeats the user preference setting for default thumbnail size. Why does this guideline make no mention of that? ―Mandruss  23:26, 1 July 2015 (UTC)