Jump to content

Module talk:InfoboxImage/Archive 1

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 04:28, 1 November 2016 (Archiving 1 discussion(s) from Module talk:InfoboxImage) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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 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}} 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 front stairs and door of Abbey Road Studios
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]] alt
[[File:Abbey Rd Studios.jpg|250px|alt=alt]] alt
[[File:Abbey Rd Studios.jpg|250px|title]] 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)

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: Alt text

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: Alt text
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)