Template talk:Plain image with caption

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Text size[edit]

Would it be possible to add an option of using the normal body-text style for the caption? I wanted to use this template for a chemical formula, but <small> tags, which I used for optical-chirality symbols that are conventionally set in SMALL CAPS, had no effect, presumably because a small style was already in effect. —Odysseus1479 (talk) 23:26, 11 November 2010 (UTC)[reply]

What is the purpose of this template?[edit]

This is a picture of the James Webb Space Telescope.
This is a picture of the James Webb Space Telescope.
This is a picture of the James Webb Space Telescope.

Hi, @Kelvinsong: and @Waldir:. I don't understand the purpose here.

What's the difference between

[[File:James Webb Space Telescope Mirror37.jpg|220px|This is a picture of the [[James Webb Space Telescope]].]]

and

{{plain image with caption|James Webb Space Telescope Mirror37.jpg|This is a picture of the [[James Webb Space Telescope]].|220|right|bottom|triangle|rgba(0,110,255,1)}}

except for the coloured triangle-arrow, and the lack/presence of borders? Please explain! Thanks. –Quiddity (talk) 19:58, 17 June 2013 (UTC)[reply]

The telescope image is probably a bad example. The template isn't meant for photographs (though I think it works quite well for them). Rather, it was built for SVG diagrams and stuff with a white or transparent background where a thumbnail border and gray rectangle becomes unnecessary and distracting, and ugly. Before, the solution was to just drop the |thumb parameter, like at Symmetry (though someone has gone and added a bunch of framed images). However you couldn't add any captions. This template is essentially a regular |thumb-less image plus a caption. See Chloroplast#Structure for examples of correct template use.
As for the triangle you ask? That's an optional addon—it's useful if you have two borderless images stacked up, and it helps readers tell which image each caption is for. —Kelvinsong (talk) 20:41, 17 June 2013 (UTC)[reply]
Oh, transparent backgrounds on diagrams. That makes sense. Hmmmm... Ok, I'll have to think about and investigate that a bit more.
It seems like the kind of thing we should create a fix for, in the normal thumbnail code, so that all Wikis (from the hundreds of Wikimedia ones, to all the other sites using Mediawiki) will be able to use the option.
Thanks for the explanation :) –Quiddity (talk) 20:27, 17 June 2013 (UTC)[reply]
Well that's what templates are for. :) I for one would like to see an easier way to center stuff like tables in MW code.
BTW, there's a shortcut to the template, just type {{plain image|...}}. A lot of the code in the template is just idiotproofing, so you can write "File:xxx.png" or just "xxx.png", etc.—Kelvinsong (talk) 20:41, 17 June 2013 (UTC)[reply]

100x100px[edit]

Any way to support the syntax 100x100px? If you are unfamiliar with that, it sets the width or height to a maximum of 100px (whichever is greater). Thus, an image in landscape format will be 100px wide, but one in portrait format will be 100px tall. howcheng {chat} 22:00, 17 June 2015 (UTC)[reply]

 Done I added the height parameter. --Great Brightstar (talk) 03:45, 17 September 2019 (UTC)[reply]

Reverted change because of linter error[edit]

Hi! I've just reverted DigitalIceAge's change because it causes a Linter error "Bogus file options". That's because for certain parameters, it causes an empty option to show up. I noticed this at National Register of Historic Places listings in Texas, which uses {{Plain image with caption|JA Ranch IMG 0052.JPG|[[JA Ranch]], [[Claude, Texas|Claude]]|400px|right}}

DigitalIceAge, could you try your changes in a sandbox first, so that we can work out this bug first? --rchard2scout (talk) 13:01, 31 January 2022 (UTC)[reply]

@Rchard2scout: I figured out that this was caused by an errrant pipe between the end of the upright variable and the beginning of the width variable. Checked in my user sandbox to see if the testcase disappeared from Special:LintErrors/bogus-image-options—it seems to have done the trick. Thanks for pointing that out! DigitalIceAge (talk) 16:31, 31 January 2022 (UTC)[reply]
That looks like it worked! bogus-image-options in Article space is as empty as it should be, and lintHint is also telling me it works. Thanks! --rchard2scout (talk) 08:41, 1 February 2022 (UTC)[reply]