Module talk:InfoboxImage/Archive 1

Latest comment: 4 years ago by Cobaltcigs in topic Dealing with tall images
Archive 1

Error handling

I've listed some common infobox errors at User:John of Reading/Image errors. Anyone interested in this LUA module might like to take a look. -- John of Reading (talk) 10:02, 26 March 2013 (UTC)

I've done some work on this. Have done the following:
Any other suggestions would be welcome. There is also the task to roll it out to more infoboxes since I only did it to most of those that were using the {{Hide if placeholder image}} template. -- WOSlinker (talk) 21:55, 26 March 2013 (UTC)
This looks good! I've updated the descriptions at User:John of Reading/Image errors. -- John of Reading (talk) 22:15, 26 March 2013 (UTC)

Suggestion: maximum size

I have a suggestion: some infoboxes (e.g., Infobox mountain) have a maximum size parameter for their image. Can someone add this feature to this module? I could try to figure out Lua syntax, but it may be faster for someone who knows what they are doing. —hike395 (talk) 12:05, 29 March 2013 (UTC)

Yes, will have a look. Was already thinking about adding it. -- WOSlinker (talk) 13:12, 29 March 2013 (UTC)
done. -- WOSlinker (talk) 13:42, 29 March 2013 (UTC)

Improve description

The description say "Inputs: image - Can either be a bare filename or a fully formatted image link" but the examples show three versions that work: fully formatted, "File:xxxxx.xxx" and "xxxx.xxx" Is there a simple way to expand the description to include the third case? Rmhermen (talk) 17:27, 29 March 2013 (UTC)

I've updated it a bit. There also the doc page at Module:InfoboxImage/doc which could do with some further expansion. Contributions are very welcome. -- WOSlinker (talk) 18:20, 29 March 2013 (UTC)

http/https

The tests for image names beginning "http:" should also catch "https:", shouldn't they? -- John of Reading (talk) 16:50, 4 April 2013 (UTC)

Yes and done. -- WOSlinker (talk) 18:04, 4 April 2013 (UTC)

Code optimization

image = mw.ustring.sub(image,6,mw.ustring.len(image)); can be shorten to image = mw.ustring.sub(image,6);. The third argument for ustring.sub can be omitted. mw:Extension:Scribunto/Lua reference manual#string.sub -- ChongDae (talk) 03:12, 8 April 2013 (UTC)

I've updated the code. -- WOSlinker (talk) 06:31, 8 April 2013 (UTC)

Documentation for module

Why doint we create a seprate documentation for module for example templates use template:documentation why doint we create module:documentation so that it support stuff for module which the template doesent instead of liking to start for documentation and then linking box for end box 86.139.246.76 (talk) 15:13, 20 April 2013 (UTC)

Error in the code

Hello. I just saw, that in the example

{{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios}}  

the text from the alt-attribute doesn't appear in Firefox 21 like a tooltip. Why? I think, that the code has to be changed. The resulting Wiki code now is:

[[File:Abbey Rd Studios.jpg|250px|alt=The front stairs and door of Abbey Road Studios]]

But it has to be a little bit other:

[[File:Abbey Rd Studios.jpg|250px|The front stairs and door of Abbey Road Studios]]

I think, that you mixed the alt parameter of the module with the Wiki image coding. I created a working version on the page eo:Modulo:InfoboxImage. I also added a new parameter center there. It works very fine on the page eo:Vikipedio:Lua/Moduloj/InfoboxImage/en. But the linked version is a little bit localized for the language Esperanto. The code lines with dosiero: has not to be copied. Greetings --Tlustulimu (talk) 11:12, 22 June 2013 (UTC)

I just created a sandbox version of this module. It works now:
{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios}}  
{{#invoke:InfoboxImage/sandbox|InfoboxImage|image=Abbey Rd Studios.jpg|sizedefault=250px|alt=The front stairs and door of Abbey Road Studios|center=yes}}
 
The second example uses the new parameter center now. I works very fine. Greetings --Tlustulimu (talk) 11:32, 22 June 2013 (UTC)

Hi, Wikipedia has both alt and title params for images. I've listed the options below. I'll add the center param and for the alt, what I'll do is add a title param and do the code so that if the title param is blank, the alt value will be used instead. -- WOSlinker (talk) 11:45, 22 June 2013 (UTC)

[[File:Abbey Rd Studios.jpg|250px|alt=alt|title]]  
[[File:Abbey Rd Studios.jpg|250px|alt=alt]]  
[[File:Abbey Rd Studios.jpg|250px|title]]  

The parameter center doesn't work. Why? --Tlustulimu (talk) 11:59, 22 June 2013 (UTC)

suppress placeholder

Per the consensus on WP:IPH, should 'suppressplaceholder' not be standard 'no', so that it needs to be overridden? Or did I miss something in the code here? --Dirk Beetstra T C 07:54, 14 January 2014 (UTC)

It currently defaults to 'no'. For example:
{{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg|suppressplaceholder=yes}}
{{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg|suppressplaceholder=no}}  
{{#invoke:InfoboxImage|InfoboxImage|image=Image is needed male.svg}}
-- WOSlinker (talk) 09:25, 14 January 2014 (UTC)
Sorry, I worded my question wrong, 'suppressplaceholder=yes' should be the standard, per WP:IPH - the use of placeholder images is discouraged (unless someone can show me a 'global' discussion that has negated that consensus), and hence, should not be displayed unless overriden. --Dirk Beetstra T C 10:30, 14 January 2014 (UTC)
So, line 86 should read "unless frame.args["suppressplaceholder"] == "no" then". --Dirk Beetstra T C 10:37, 14 January 2014 (UTC)
line 86 should read "if frame.args["suppressplaceholder"] ~= "no" then" -- WOSlinker (talk) 11:40, 14 January 2014 (UTC)
Also, the images that are in Category:Wikipedia_image_placeholders should standard be in the list of placeholder images. --Dirk Beetstra T C 10:43, 14 January 2014 (UTC)
More could be added to the list in the module if needed. -- WOSlinker (talk) 11:40, 14 January 2014 (UTC)

Make the module working with all Wikipedias

This original module handles the prefixes of namespace 6 by hardcoding ("file:" and "image:"). However, there might be more alias names of namespace 6 in some Wikipedias. The sandbox version fetches alias names via the library directly; hence, it solves this problem. --Nullzero (talk) 04:18, 12 January 2014 (UTC)

  •   Question: Wouldn't it be the simplest to just replace all of the words with {{ns:6}}? Note that since this module is only used on enwp (if you import move it to another wiki, feel free to change the code as needed there), so I'm not sure what you want changed here. Can you be more specific please? Technical 13 (talk) 05:05, 12 January 2014 (UTC)
Feel free to reactivate when you answer the question. Happy editing! Technical 13 (talk) 08:12, 12 January 2014 (UTC)

@Technical 13 Sorry that I didn't make it clear. So, yes, the original code is perfect enough for enwp and for now. I just saw that there are hard codings in this module, which annoy me because I believe that if it is possible, there should be no hardcoding. If this module is changed in the way that it retrieves information from the library directly, there will be two advantages. First, suppose in the future enwp adds more alias names of ns6, you don't have to fix the module, as the module fetches the new config automatically. Second, it's easy for another wikis to import this module. thwp, for example, has these names as the alias names of ns6: "file", "image", "ไฟล์", "ภาพ". If I want to import this module, for original code, I have to add this additional code:

    if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "ไฟล์:" then
        image = mw.ustring.sub(image,6);
    end
    if mw.ustring.lower(mw.ustring.sub(image,1,4)) == "ภาพ:" then
        image = mw.ustring.sub(image,5);
    end

However, the sandbox version works well without having to add anything!

I don't understand the sentence "Wouldn't it be the simplest to just replace all of the words with {{ns:6}}?" because I can't even see this process in the original code. The process of the sandbox version is exactly the same as that of the original code. For the original code, the process is to cut the "file:" or "image:", and then add [[file:. For the sandbox version, the process is to cut whatever prefix, including "file:" and "image:", and then add "[[file:". --Nullzero (talk) 01:34, 13 January 2014 (UTC)

The change seems reasonable. I can't do it myself at this exact moment, but if no-one else does it soon, I'll be back later to do it. -- WOSlinker (talk) 07:20, 14 January 2014 (UTC)
  Done -- WOSlinker (talk) 19:10, 14 January 2014 (UTC)

http

Maybe some example using http/https could be add to documentation? Currently I don't aunderstand how it works. --Edgars2007 (talk/contribs) 02:41, 27 April 2014 (UTC)

By design, it doesn't work. A common error by new editors is to try to use external link syntax for the image name. This used to result in a mess, but the module now spots the error and deliberately displays nothing. There are examples at User:John of Reading/Image errors. -- John of Reading (talk) 07:47, 27 April 2014 (UTC)
Thanks! --Edgars2007 (talk/contribs) 12:19, 27 April 2014 (UTC)

Link not used often?

The documentation now says about |link= (not used very often). Why is this? AFAIK, clicking on a image is as internet as is clicking on a hyperlinked text. WP:EIS and Wikipedia:Images linking to articles mainly point to (c) issues to be taken care of (which is more an site check issue), if at all. Clicking without link leads to the engoine room of the picture (not even a fullscreen image). I don't know if that is what the reader expects. In short, I'd like that statement to be more specific, or MOS-clrified, or be removed. -DePiep (talk) 14:27, 14 March 2014 (UTC)

Removed the quote from doc page. -DePiep (talk) 20:46, 27 April 2014 (UTC)

Caption

Maybe there could be added parameter for caption (and for captionstyle which could have some default value (I suppose it could be taken from infobox module). Template:Infobox royalty, for example, uses this module, but isn't based on infobox template, so for caption there has to be "complex" check. --Edgars2007 (talk/contribs) 12:10, 21 June 2014 (UTC)

  Not done: please make your requested changes to the module's sandbox first; see WP:TESTCASES. Jackmcbarn (talk) 17:08, 21 June 2014 (UTC)
The module is just designed for handling the different ways of specifying an image for displaying in an infobox. I don't think that it would be possible to include the infobox caption in this module. To do so, the module would need to be merged into the infobox module and then support for some caption processing could be added as well. -- WOSlinker (talk) 11:45, 22 June 2014 (UTC)

Compute image box

In the sandbox I've implemented a change that would allow specifying image sizes as "widthxheightpx with both dimentions being optional (as opposed to current widthpx). The result may be evaluated at testcases page. As a side effect, absolute maximum dimentions are now also enforced. (I've chosen arbitrary value of 800 for both.) I believe this change to be an uncontroversial improvement, but I would like to solicit some input before I implement them in production module. — Dmitrij D. Czarkoff (talktrack) 21:44, 1 July 2014 (UTC)

Use in topical infobox?

First let me note (to myself) that {{Infobox image}} has nothing to do with this module, and is a stand-alone box.

Now my question is: when building a topical infobox using meta {{Infobox}}, would there be any profit for someone to use this module? If I'm correct, the diff would look like:

{{infobox
| image1=[[File:Abbey Rd Studios.jpg|250px|alt=Example alt text]]
| caption1={{{caption|}}}
...
}}
{{infobox
| image1={{#invoke:InfoboxImage|InfoboxImage|image=Abbey Rd Studios.jpg|250px|center=yes}}
| caption1={{{caption|}}}
...
}}

I see extra params available, so I can use them:

maxsize, sizedefault, suppressplaceholder, center

Is there an #ifexist: shortcut I could use? (so there would be no need for me to write a preliminary ifexist check before calling the image). -DePiep (talk) 12:44, 19 July 2014 (UTC)

there are a few advantages to using this template. (1) the input is not as rigid. for example,
{{Infobox person
| image = Example.png
}}
{{Infobox person
| image = File:Example.png
}}
{{Infobox person
| image = [[File:Example.png|frameless]]
}}
are all functional. (2) it can filter out placeholder images. (3) it can find uses of 'thumb' within the image field,
{{Infobox person
| image = [[File:Example.png|thumb|this should probably not be allowed]]
}}
(4) it can partially enforce a maximum size. as far as the 'ifexist' check goes, it's not implemented, although there is no serious reason why a partial check could not be added. it would add some cost, but should be generally possible. Frietjes (talk) 22:30, 21 July 2014 (UTC)
thx. -DePiep (talk) 15:09, 24 July 2014 (UTC)

Using User-preferred thumbsize

Thanks, only profits then. Worth learning this one. btw, I learned from Christian75 that this module also uses a "default size" (wiki setting, adjustable in user:preferences for logged-in users). It would be nice if the documentation could start describing this (in a section below). -DePiep (talk) 11:05, 22 July 2014 (UTC)
The sizedefault parameter already mentioned that it defaulted to frameless. I've now added a link on that word to Wikipedia:Autosizing images. -- WOSlinker (talk) 12:13, 22 July 2014 (UTC)
That's the link needed & I could not think of myself. An improvement. -DePiep (talk) 15:56, 22 July 2014 (UTC)
(about #ifexist): Its not normal to check if the image exist in infoboxes (its pretty clear that it doesnt exist after preview/saving). But the modules output is nothing if the parameter image is undefined, as in: "{{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size=100|border=yes}}" gives (I added the "): "". Christian75 (talk) 21:45, 23 July 2014 (UTC)
So obvious by logic, so difficult for me to discover ;-). Thx. -DePiep (talk) 14:34, 24 July 2014 (UTC)

upright?

To add to /doc: What is & does |upright=? -DePiep (talk) 22:37, 9 August 2014 (UTC)

It's mentioned on Wikipedia:Autosizing images. You are welcome to update the docs. -- WOSlinker (talk) 23:31, 9 August 2014 (UTC)
...I hoped the documentation could update me. Anyway, I should understand that the "upright" word is not very to the point, clarifying or even correct. It is a linear factor applied to the default size. -DePiep (talk) 15:10, 10 August 2014 (UTC)
I'm not really that sure myself about it as I don't use it but have added some more docs on it. -- WOSlinker (talk) 19:25, 10 August 2014 (UTC)
Good this way. I find these mutually interactive & conditional parameters a load to learn. It reminds me of these early DOS years. -DePiep (talk) 19:41, 10 August 2014 (UTC)

Template-protected edit request on 20 August 2014

If this is the image of the dart system someone needs to update the map in orange from belt line to dfwRicHicks (talk) 21:31, 20 August 2014 (UTC) RicHicks (talk) 21:31, 20 August 2014 (UTC)

@RicHicks:   Not done: this is the talk page for discussing improvements to the page Module:InfoboxImage. Please make your request at the talk page for the article concerned. Judging by this thread on your talk page, you have some problem at the page Burbank (DART station), but it's not clear what. A change to Module:InfoboxImage - which is used on 1.8 million pages to format images in infoboxes - is unlikely to be the solution. --Redrose64 (talk) 23:04, 20 August 2014 (UTC)

http categorization

Maybe it is worth to add some tracking category for articles, that uses http(s) for images, just to track down them as for thumbs? --Edgars2007 (talk/contribs) 07:42, 6 September 2014 (UTC)

Template-protected edit request on 14 October 2014

[1] interview with John Brumley who identified the Wahkpa Chu'gn Buffalo Jump

producer / director : Ray Ekness at UofMT at Missoula series: Backroads of Montana medium: video personalities: Ray Ekness, John Brumley date : 2013

I also have 4 jpg images of the Wahkpa Chu'gn Buffalo Jump site to contribute

Jan normandale (talk) 02:53, 14 October 2014 (UTC)

  Not done Jan normandale I think you are confused about the change you were requested. This is the page to request changes to this programming module Module:InfoboxImage. — xaosflux Talk 03:43, 14 October 2014 (UTC)

Alt text versus title text

Hello,

The module currently uses the alt text as title text when no title text is provided; alt text and title text are not the same thing, so this doesn't seem a good idea to me... The alt text is supposed to provide information that can replace the image's graphics, whereas the title text is a possibility to supplement the image's graphics with additional information. Currently, if a visual description of the image is passed as alt text, the module also displays it as a title text, even though it isn't relevant there (see the infobox in Space Invaders for an example).

Shouldn't this be changed? (Quickly scrolling through this page, I see that this behavior was defined by WOSlinker following the #Error in the code discussion above.)

Cos-fr (talk) 09:47, 19 September 2014 (UTC)

Agreed that this is a bad idea. Agents processing the page source expect the title text to be extra information that can be meaningfully displayed alongside the image; with alt text this tends to have awkward results. To give a specific example, MediaViewer displays title text as the image caption; if there is no title text, it fetches a caption from other sources (such as the image description page). No title text gives much more meaningful results than alt text duplicated as title text. --Tgr (WMF) (talk) 01:22, 26 November 2014 (UTC)

Suggestion: landscape

@WOSlinker: some infoboxes, like Template:Infobox church, uses |landscape=yes. Maybe it could be imported in this module somehow? --Edgars2007 (talk/contribs) 10:32, 27 February 2015 (UTC)

I'm not sure if it could be included in the module directly as the code appears to be specific to that infobox. However, I have updated Template:Infobox church/sandbox to use InfoboxImage and including the landscape option. This could be copied over to the live template if you are happy with it. -- WOSlinker (talk) 13:07, 27 February 2015 (UTC)
@WOSlinker: I think there could be some three params in the template code |landscape={{{landscape|yes}}}, |landscape x=250, |landscape y=300, or something like that. The rest of the code should be the same for all templates, I think. About the sandbox version - thanks, but I haven't used it, that was just an example :) --Edgars2007 (talk/contribs) 13:55, 27 February 2015 (UTC)

Error when parameter missing

This edit, applying this module, seems to be the cause of the error showing on this page. This workaround fixed it, but the error needs a permanent solution. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 09:44, 24 June 2015 (UTC)

There's no way to catch the error here; it needs to be fixed in Module:Wikidata. Alakzi (talk) 10:53, 24 June 2015 (UTC)

Using upright without a value

This module is currently capable of adding "|upright=value":

  • {{#invoke:InfoboxImage|InfoboxImage|image={{{image}}}.jpg|alt=Alt text|border=yes|upright=1.2}}
  • Output: [[File:{{{image}}}.jpg|frameless|alt=Alt text|border|upright=1.2]]

I would like to be able to add "|upright" without a value, similar to the way "|center" or "|border" is added. Below is a working example using updated code at Module:InfoboxImage/sandbox:

  • {{#invoke:InfoboxImage/sandbox|InfoboxImage|image={{{image}}}.jpg|alt=Alt text|border=yes|upright=yes}}
  • Output: [[File:{{{image}}}.jpg|frameless|alt=Alt text|border|upright]]

What prompted this was finding an infobox invoking this module with "title=upright". While that works, it is not the intended use and it overrides this module's placement of "alt" text when "title" is not defined:

  • {{#invoke:InfoboxImage|InfoboxImage|image={{{image}}}.jpg|alt=Alt text|border=yes|title=upright}}
  • Output: [[File:{{{image}}}.jpg|frameless|alt=Alt text|border|upright]]

I know there are workarounds such as "upright=0.75" or even "upright=0" that produce the same results (see examples at User:Zyxw/upright), but since the image syntax allows "upright" without a value (see WP:Extended image syntax § Size), this template should have a way to implement that. The two line addition (sandbox diff) is tested and working (test cases), just wanted to post this for comment before making the change. -- Zyxw (talk) 02:16, 9 September 2015 (UTC)

Suggestion

Would it be possible to get an option for a maintenance category here? So for example in {{Infobox settlement}} automatically add the page to the hidden maintenance category Settlements with an infobox but no image? The module is awesome and would be really nice to just have an option to supply the name of the maintenance category to put the page in if the image is missing. --Zackmann08 (Talk to me/What I been doing) 00:59, 13 September 2015 (UTC)

Missing |page param (DjVu)

I'm trying to use a specific page from a DjVu file as an image in an infobox ({{Infobox magazine}}) but am only getting the first page (which is Google's scanning boilerplate). Scanning the source for this module I also see no reference to to a |page parameter (the infobox in question does have it, as |image_page, though). Was this forgotten for the Lua module, or am I missing something?

Test case:  

Provided I have understood how this works correctly, so long as that image shows as Google's boilerplate the module is ignoring the given page. The correct image (page) is an 18th-century engraved fronticpiece of a woman starting pensively at a globe. --Xover (talk) 07:01, 14 October 2015 (UTC)

I went ahead and attempted to fix it myself in the sandbox, and spectacularly dumb mistakes in the first attempt aside, I think it worked.
Sandbox test case:  
I'll go ahead and update docs and testcases so it's complete whenever someone has time to review the proposed changes. --Xover (talk) 10:26, 14 October 2015 (UTC)
Looks fine. I've copied it over to live. -- 11:46, 14 October 2015 (UTC)

List of placeholder images

@Magog the Ogre:. I'm not convinced by this edit. This list is intended to be a complete alphabetical list of placeholder images, so that templates can ask the module to suppress display of placeholders. -- John of Reading (talk) 07:12, 31 October 2015 (UTC)

Image is needed male.svg was already in the list further up anyway, so I've undone that change. -- WOSlinker (talk) 07:43, 31 October 2015 (UTC)

Imagemap support

This module needs to be updated to support "imagemap", per the example at The Doctor (Doctor Who) to remove any extraneous markup. There is only one image used (File:Versions of the Doctor.jpg), but multiple different links over the one image. A template or module should reflect all possible usages of it; even though this is only one such case, there may be other cases of this on Wikipedia. I'd do it myself in the sandbox, but I'm not entirely familiar with this module. Alex|The|Whovian? 23:59, 13 March 2016 (UTC)

This still needs fixing. Alex|The|Whovian? 13:22, 4 April 2016 (UTC)
This should now be fixed. -- WOSlinker (talk) 14:32, 4 April 2016 (UTC)

"title=" parameter: relevance?

How relevant is it to support the |title= parameter, especially next to the |alt= parameter? (i.e., the css-tiles a.k.a. mousehover-text; |alt=-value is used when missing).

I get the 'css-title' angle, but not in WP:EIS and not in WP:FILE we have an option for that. So when adding a plain file to an article (outside of infobox), the option 'css-title' is not available. My question starts from {{Chembox}}, which has 400+ parameters. I'd like to simplify this list, eg by removing this title parameter (pushing the alt parameter). -DePiep (talk) 19:58, 25 May 2016 (UTC)

There is an archived posting at Module talk:InfoboxImage/Archive 1#Alt text versus title text which discusses the differences. Also, the text assigned to the |title= parameter is placed into the normal image syntax (referred to as Caption at WP:EIS), so:
{{#invoke:InfoboxImage|InfoboxImage|image=Example.png|alt=Alt text|title=Title text}}
will output the following (which could be placed into an article, inside or outside an infobox):
[[File:Example.png|frameless|alt=Alt text|Title text]].
An example of using both fields (with "thumb" instead of "frameless") can be found at WP:FILE#Using files. -- Zyxw (talk) 04:03, 14 July 2016 (UTC)
Zyxw thanks, my question solved. So in my case, parameter title is redundant to parameter caption. (btw, mistake in my OP: 'title' in InfoboxImage is not the same as css-title in a tag like <span title="css-title example">. Glad it did not distract you). -DePiep (talk) 05:32, 14 July 2016 (UTC)
Glad that helped. I assume that "Caption" was used in WP:EIS because it is displayed as a caption when using "thumb". However, "title" more accurately describes it when using "frameless", because if you look at the generated HTML it is used as a title attribute in the anchor tag that surrounds the image tag: <a href="/wiki/File:Example.png" class="image" title="Title text"><img alt="Alt text" src= ... -- Zyxw (talk) 06:28, 14 July 2016 (UTC)
  • Sorry, this is getting into a headache.
First of all, WP:EIS shows the horror of interacting parameters, thereby changing their semantics. Like this: "If the type is 'frameless', the caption value moves & changes into title (mousehover) text" (I conclude after studying the doc). No end editor should be loaded with this illogic. No software encoder should allow such change of meaning & usage.
Next, this Module:InfoboxImage adds to these parameter mixups by suggesting |title= replaces [[File:|...|Caption text]] (see this /doc section, first paragraph saying [[File:..|{{{TitleText}}}]] -- the position where WP:EIS says Caption text is expected). There is no gain in confusing those two concepts in this module either.
To support my point, I quote from your 2014 link by Tgr (WMF): "To give a specific example, MediaViewer displays title text as the image caption; ..." (ie, another mixup variant, this time by MediaViewer). Also, you (Zyxw) wrote above: "Also, the text assigned to the |title= parameter is placed into the normal image syntax (referred to as Caption at WP:EIS)". This 'title' is named 'Caption' in WP:EIS?
Now there is no use in explaining the 'logic' behind this once more. I'd prever we don't change parameter semantics. And this module should not deviate from [[File:...]] documentation (itself to be improved).
As for understanding this module, I can say: Module:InfoboxImage does not have the concept or option of a Caption (meaning: text below an image). Such text is to be entered in the {{Infobox}} template using separate |caption=Caption text, next to (not inside) |image={{#invoke:InfoboxImage|...}}.
On the other hand, if one enters |image= directly by [[File:..]], the caption option is available in the File:-settings.
-DePiep (talk) 09:32, 14 July 2016 (UTC)

Category:Pages using infoboxes with thumbnail images

Hoping to get some help. I am trying to clean out Category:Pages using infoboxes with thumbnail images. Obviously this is a very tedious project but it is made all the more frustrating by the fact that new pages keep getting added to the category. I'm wondering, is there some way to add something to this module that will display an error in preview mode when people try to add new thumbnails? Any thoughts? --Zackmann08 (Talk to me/What I been doing) 03:15, 16 July 2016 (UTC)

@WOSlinker: Any thoughts? --Zackmann08 (Talk to me/What I been doing) 00:13, 17 July 2016 (UTC)
Probably using the REVISIONID feature similar to Module:Check_for_unknown_parameters it can be done. I'll have to see what I can do. -- WOSlinker (talk) 08:04, 17 July 2016 (UTC)
@WOSlinker: fantastic! I've not done any work with modules before, and don't have the necessary permissions to edit this page, but if I can be useful in anyway, please let me know. I do have a background in computer programming and would be happy to pair with you on making this happen. Thanks for taking some time to look into this! As a side note, as I continue to willow down this category, it would be great for it to ultimately throw an error on the actual page. Right now that doesn't make sense as there are over 3,000 pages in the category... But thought for the future. --Zackmann08 (Talk to me/What I been doing) 22:15, 17 July 2016 (UTC)
@WOSlinker: I'd like to amend my request. The category is now just over 1,500. My goal is to have the category at 0 by the end of the week. What would be great is to just disallow the use of thumbs in infoboxes entirely. Either have it throw an {{error}} or just remove 'thumb' and force the image to appear inline. @John of Reading: you've been active on this project as well. Thoughts? --Zackmann08 (Talk to me/What I been doing) 19:19, 19 July 2016 (UTC)
Would probably be better to replace thumb and thumbnail with frameless rather than just removing it. I've updated the code in Module:InfoboxImage/sandbox. -- WOSlinker (talk) 20:26, 19 July 2016 (UTC)
@WOSlinker: I'm not convinced by the sandbox change. If the [[File:...|thumb|...]] includes a caption, changing from "thumb" to "frameless" makes the caption disappear, which would be confusing. It would still need a tracking category so that someone can move the caption into the proper "caption" parameter. -- John of Reading (talk) 21:21, 19 July 2016 (UTC)
How about with the cat added back but still changing thumb to frameless ? -- WOSlinker (talk) 22:00, 19 July 2016 (UTC)
That would be better than the current sandbox code. However, I'd still prefer the current live code, adding the category but leaving the file specification untouched. Another confusing scenario: the caption is visible in a draft article or user subpage, but it disappears when the page is moved to mainspace. -- John of Reading (talk) 04:59, 20 July 2016 (UTC)

What about just throwing an error? Force the user to fix it themselves? --Zackmann08 (Talk to me/What I been doing) 05:30, 20 July 2016 (UTC)

New users won't necessarily be able to fix it themselves, even if they manage to find the template documentation. -- John of Reading (talk) 07:15, 20 July 2016 (UTC)
@WOSlinker and John of Reading: You make a valid point, I'm just curious at what point do we stop holding new users hands and force them to learn? Playing devils advocate here. Is there a middle ground? The error can also link to WP:INFOBOXIMAGE which can be expanded to explain how to resolve the issue if you feel it needs to be. I've been continuing to monitor the category and I would say an average of 50 new pages fall into it each day. --Zackmann08 (Talk to me/What I been doing) 23:53, 25 July 2016 (UTC)

Pages using deprecated image syntax

Hello all. I'm not too experienced with editing Modules but I wanted to see if there was a way to get Category:Pages using deprecated image syntax added to this. Essentially a check for:

|image = [[File:FooBar.jpg|200px]]

which according to the new syntax should be:

|image = FooBar.jpg

In one template (Template:Infobox book series) I saw this handled thusly:

|{{#ifeq:{{str left|{{{image|}}}|1}}|[ |{{main other|[[Category:Pages using deprecated image syntax]]}} }

Thoughts? --Zackmann08 (Talk to me/What I been doing) 16:15, 31 October 2016 (UTC)

@WOSlinker and John of Reading: you were both helpful to me during a previous discussion regarding this Module. Any thoughts on this? --Zackmann08 (Talk to me/What I been doing) 18:57, 31 October 2016 (UTC)
Are you wanting it as an option within this module or do you want it on all the time? -- WOSlinker (talk) 22:50, 31 October 2016 (UTC)
@WOSlinker: my thought was to have it on all the time much like Category:Pages using infoboxes with thumbnail images. Please bare in mind that I have never written a Module so I'm not 100% certain of the syntax, but I would imagine that taking lines 162-168 and making them the following would work?
if mw.ustring.sub(image,1,2) == "[[" then
   -- search for thumbnail images and add to tracking cat if found
   if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
      return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
   else
      return image .. "[[Category:Pages using deprecated image syntax]]";
   end
elseif....
I BELIEVE that what that will do is add any page where the image param starts with [[ to Category:Pages using deprecated image syntax. --Zackmann08 (Talk to me/What I been doing) 23:54, 31 October 2016 (UTC)
Nearly ok, but only want to add that category to mainspace articles, so need this:
if mw.ustring.sub(image,1,2) == "[[" then
   -- search for thumbnail images and add to tracking cat if found
   if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
      return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
   elseif mw.title.getCurrentTitle().namespace == 0 then
      return image .. "[[Category:Pages using deprecated image syntax]]";
   else
      return image;
   end
elseif....
Will add it in a day or two if no objections made. -- WOSlinker (talk) 08:56, 1 November 2016 (UTC)
@WOSlinker: I was so closeee!!! Thanks for the assistance. :-) --Zackmann08 (Talk to me/What I been doing) 16:44, 1 November 2016 (UTC)
@Zackmann08: I've now updated the module. -- WOSlinker (talk) 13:53, 4 November 2016 (UTC)

Adding drafts to tracking category

Hello all. I wanted to see if we could revise this to add pages in the draft namespace to Category:Pages using infoboxes with thumbnail images. It would help catch these before they get pushed to the main space. Doesn't make a huge difference but would be nice. :-) --Zackmann08 (Talk to me/What I been doing) 17:21, 15 December 2016 (UTC)

  Done Did it a couple of hours ago, but then forgot to reply. -- WOSlinker (talk) 20:43, 15 December 2016 (UTC)
Object per concept (for future). Either it is "Cat:Pages ..." including all, or it is "Cat:Articles ...". -DePiep (talk) 21:00, 15 December 2016 (UTC)
@WOSlinker: I'm actually going to undo this change. After a few days of it being there I've realized that all it does is flood the category with Drafts that are likely never to become articles. Of the 75 or so pages I've fixed in the draft space, at least 50 of them were outright spam that would never pass WP:AFC. I think it is fine to just catch the few that slip through once they hit the main article space. --Zackmann08 (Talk to me/What I been doing) 19:18, 20 December 2016 (UTC)

Bug when sizedefault is just a number

I added the same "px adding" logic for sizedefault so |sizedefault=250 is the same as |sizedefault=250px. please revert and let me know if this causes a problem, but all the examples look fine. Frietjes (talk) 14:52, 12 March 2017 (UTC)

How to suppress "100px" when image is specified but does not exist

In the last example in the documentation, a nonexistent file shows "100px" in red if a file is specified but does not exist. Is there a way to track this problem, display an error message, suppress any display entirely, or some combination of those? I encountered this problem here and was unable to fix it by changing the infobox. It is probably better to solve the problem here rather than in every template that calls this module. – Jonesey95 (talk) 22:52, 24 August 2017 (UTC)

User page being added?

Anyone have any idea why/how User:ABaso (WMF)/sandbox/Module:InfoboxImage is being added to Category:Pages using infoboxes with thumbnail images? I thought only main articles could be added... --Zackmann08 (Talk to me/What I been doing) 18:26, 27 August 2017 (UTC)

Because the categories are literally included in the page, typed in double square brackets, as you would include a category manually in any page by typing the category's name. – Jonesey95 (talk) 22:42, 27 August 2017 (UTC)
@Jonesey95: HAHAHAH!!!! Ok I well and truly earned myself a WP:TROUT!! Thanks! --Zackmann08 (Talk to me/What I been doing) 00:38, 28 August 2017 (UTC)
Nah. I only knew because I've been bitten by the same thing more than once. It's a devil to figure out when you are sure that the only way to get the category you are looking at is to use the template or module. – Jonesey95 (talk) 01:46, 28 August 2017 (UTC)

Template-protected edit request on 19 October 2017

Business Connexion Group changed to BCX (part of the Telkom Group) Maraisrc (talk) 08:39, 19 October 2017 (UTC)

  Not done Unclear request, does not seem to be related to this module. -- AlexTW 08:49, 19 October 2017 (UTC)

Template-protected edit request on 19 October 2017

BCX (part of the Telkom Group) formerly known as Business Connexion Group Maraisrc (talk) 08:47, 19 October 2017 (UTC)

  Not done Unclear request, does not seem to be related to this module. -- AlexTW 08:49, 19 October 2017 (UTC)

location=right is possible?

I want to position an image right in a data(n) field. With regular WP:EIS notation this is possible (in body text). Is there a reason this is not possible (or: not advised) in an infobox? -DePiep (talk) 19:18, 24 October 2017 (UTC)

it's a hack, but |title=right works. Frietjes (talk) 18:59, 27 October 2017 (UTC)

alt=?

Wanted to ask for some feedback before I made an edit that broke a lot of crap: but shouldn't alt text just be appended to the image link without using alt=? That's not valid best I remember. Fixing this would fix potentially many thousands of the "bogus file operation" lint categories. FACE WITH TEARS OF JOY [u+1F602] 03:19, 21 December 2017 (UTC)

Maybe you could make an example edit to an article, or to this module's sandbox, to show us what you mean. – Jonesey95 (talk) 04:18, 21 December 2017 (UTC)

I'm looking at the following snippet in this module:

        if alt ~= "" and alt ~= nil then
            result = result .. "|alt=" .. alt;
        end

This seems both incorrect (File links shouldn't have alt= parameters), as well as redundant, considering we handle alt/title further down. FACE WITH TEARS OF JOY [u+1F602] 23:08, 18 January 2018 (UTC)

The alt text is meant to be a description of the image for visually impaired readers and is not a redundant feature. -- WOSlinker (talk) 17:55, 19 January 2018 (UTC)

Is there a way to right-justify?

  ~ Tom.Reding (talkdgaf)  21:05, 10 March 2018 (UTC)

Just noticed the |title=right hack above. Thanks Frietjes!   ~ Tom.Reding (talkdgaf)  21:08, 10 March 2018 (UTC)

I see you've used it in {{Year in Taiwan/sandbox}}. I'm not sure there much benefit in using InfoboxImage when all the parameters are fixed values. InfoboxImage is there to tidy up the values that are passed through. -- WOSlinker (talk) 21:21, 10 March 2018 (UTC)
WOSlinker, is there another/a better way of removing them from Category:Pages using deprecated image syntax?   ~ Tom.Reding (talkdgaf)  06:07, 11 March 2018 (UTC)
That category is only added by Module:InfoboxImage when the image param starts with [[ -- WOSlinker (talk) 08:28, 11 March 2018 (UTC)
Tom.Reding the problem was upstream in the parent template. I have added a |images= to the parent template to allow the images to be preformatted. Frietjes (talk) 13:43, 11 March 2018 (UTC)

Doc Problem and Placing images side by side

According to the category Category:Pages using deprecated image syntax, it was told that the syntax |image=[[File:Example.jpg]] should not be used and it needs to be replaced by Example.jpg. If that is right, then shouldn't it be corrected in the document page of this module? Secondly, I have recently asked following question in the talk page Category talk:Pages using deprecated image syntax, but I couldn't find a complete correct answer. So I am asking it here. The question is, how can I place 2 images side by side without being separated according to the new format of including files ie. according to the latest version of this module? For example, please consider the images present in the article 3rd Pennsylvania Cavalry. Adithyak1997 (talk) 14:43, 30 August 2018 (UTC)

Thumbnails

After months of cleaning out Category:Pages using infoboxes with thumbnail images every other day or two, I'm wondering whether there isn't a better solution? Based on my experience, 99% of the time when a page is dumped into that category, it is a brand new user creating a page for the first time. They upload an image and then copy and paste the pre-generated thumbnail text from the upload wizard. So I see 2 possible solutions...

  1. Instead of displaying the image and putting the page in a category, why not just render a {{error}} message saying "Yea... Don't effing do this!" I kid on the language of course... But we could render an error saying something like "Thumbnails should not be rendered in an infobox, please provide an image name only. See WP:INFOBOXIMAGE for more information."
  2. Since we are already performing a check for thumb in the Module, why don't we just remove the thumb parameter if it is found? That way an image never renders as a thumb?

Any thoughts? --Zackmann (Talk to me/What I been doing) 20:58, 15 November 2018 (UTC)

@WOSlinker and Frietjes: do either of you have any thoughts? --Zackmann (Talk to me/What I been doing) 19:53, 18 November 2018 (UTC)
Yes, would be possible to remove thumb, but would need replacing with frameless rather than just a straight removal. Think that would be ok. -- WOSlinker (talk) 19:57, 18 November 2018 (UTC)
@WOSlinker: do you think that would be a good approach? --Zackmann (Talk to me/What I been doing) 20:00, 18 November 2018 (UTC)
WOSlinker (talk) 20:03, 18 November 2018 (UTC)
the other option would be to use css (e.g., via templatestyles) to modify all thumb images inside an infobox, but I don't know if there are any legit uses. Frietjes (talk) 14:06, 19 November 2018 (UTC)

Multiple images listed on Wikidata

Hello. For Wikidata items which has more than one image listed, it generates an error when rendered locally. For example:

  • Run {{Infobox power station/sandbox}} in edit preview of Kajaki Dam. Note the "300px" instead of an image.

Is there a way to fetch a maximum of only one value (i.e. one image), like the maxvals parameter of Module:WikidataIB? Rehman 07:05, 30 March 2019 (UTC)

Fixed it with this edit. The maxvals param was in the wrong location. -- WOSlinker (talk) 07:56, 30 March 2019 (UTC)talk-esünkre
Oops, thanks for fixing my silly error, WOSlinker. Rehman 13:06, 30 March 2019 (UTC)

Dealing with tall images

Seems like the easiest way would be to add a height constraint by changing:

size = size .. "px";

to

size = size.."x"..size.."px";

Then the actual size shown would be the largest that fits inside a size * size square (or at least, roughly so). ―cobaltcigs 11:44, 8 November 2019 (UTC)