Module talk:InfoboxImage/Archive 2
| This is an archive of past discussions about Module:InfoboxImage. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
| Archive 1 | Archive 2 | Archive 3 | Archive 4 |
Help with improving default image sizes
A few editors had a contentious but thoughtful discussion about default image sizes in infoboxes that fizzled out due to lack of technical expertise; see this discussion from July 2022. It looks like the next step was to post a request for help here. Basically, we thought that this module might be able to do a better job of providing images for infoboxes that followed editors' thumb size preferences so that we could move away from fixed pixel size specifications in infoboxes. If there is anyone here who is willing to look into how we might default to frameless (or whether the module already does this, and how to code infobox image calls properly), I would be grateful. – Jonesey95 (talk) 01:03, 10 January 2023 (UTC)
Ditto. On some other wikis you format the image inside the info box, and can just use 'upright' to size, but on WP-en it's too complicated for me to figure out. It would be nice if at e.g. the language infobox we could set the default to, say, upright=0.9, and editors could override with their own upright value if they chose.
Is it possible to set the infobox width to match the user's default image size, or would that be a bad idea? — kwami (talk) 01:45, 10 January 2023 (UTC)
- Perhaps I am misunderstanding the discussion or request. There is already a parameter
|upright=to this Module, which is passed along to the [[Image:XXX]] wikitext. If you want an infobox image to default to 114% of the size of a user's preference, why not just set|upright=1.14in the infobox code? What am I missing? — hike395 (talk) 03:51, 10 January 2023 (UTC)- In my case, that I don't know what I'm doing with this module! — kwami (talk) 03:53, 10 January 2023 (UTC)
- Is there a specific infobox we can try to improve? Maybe that will make things clearer (or maybe there will an unanticipated problem and we'll learn from the attempt). — hike395 (talk) 03:55, 10 January 2023 (UTC)
- Yes, thank you. {{Infobox language}}, which I could then extend to Infobox language family. — kwami (talk) 03:57, 10 January 2023 (UTC)
- Is the idea to default to
|upright=0.9(~200/220) ? Let's try it in the sandbox. — hike395 (talk) 03:58, 10 January 2023 (UTC)- Currently, 'image' is set to 90% and 'map' to 100%. — kwami (talk) 03:59, 10 January 2023 (UTC)
- Looks like it worked, see Template:Infobox language/testcases. My default image size is 250px, and it clearly changed for me. It still allows fixed-size overriding, but the default will obey user preferences. Hopefully this will resolve the dispute that seemed to happen at Template talk:Infobox bridge/Archive 2?
- I'll leave it to other editors to get consensus on this change, but it seems to work technically. — hike395 (talk) 04:07, 10 January 2023 (UTC)
- Thanks!
- Would it be possible to set it so that if we enter, say, 'mapsize' or 'imagesize=1.25', it will set it as upright=1.25, so we don't have to use px? — kwami (talk) 04:18, 10 January 2023 (UTC)
- I guess we could check to see if the mapsize is <4, use it as upright? I worry that this will be confusing to editors. — hike395 (talk) 05:56, 10 January 2023 (UTC)
- Currently, 'image' is set to 90% and 'map' to 100%. — kwami (talk) 03:59, 10 January 2023 (UTC)
- Is the idea to default to
- Yes, thank you. {{Infobox language}}, which I could then extend to Infobox language family. — kwami (talk) 03:57, 10 January 2023 (UTC)
- Is there a specific infobox we can try to improve? Maybe that will make things clearer (or maybe there will an unanticipated problem and we'll learn from the attempt). — hike395 (talk) 03:55, 10 January 2023 (UTC)
- In my case, that I don't know what I'm doing with this module! — kwami (talk) 03:53, 10 January 2023 (UTC)
It looks like using |upright= will generally work, as shown at Template:Infobox bridge/testcases (set your thumbnail preference to 300px or higher to see the difference). Somewhere (I forget where, unfortunately), an editor chose to specify an infobox image size to match the pixel size of the mapframe map in the infobox. I don't see a way to apply |upright= to mapframe maps, so I posted a query at the relevant talk page. – Jonesey95 (talk) 05:04, 10 January 2023 (UTC)
- Anything other than a number in mapsize gives the same output, ~ equivalent to entering 500. — kwami (talk) 06:25, 10 January 2023 (UTC)
- I've changed the infobox, checking articles. No problems so far. — kwami (talk) 06:26, 10 January 2023 (UTC)
- I don't see how |upright= has any effect on anything. — kwami (talk) 06:29, 10 January 2023 (UTC)
- @Kwamikagami: Have you tried changing your preference for thumbnail size away from 220px? — hike395 (talk) 07:09, 10 January 2023 (UTC)
- No, but I would think that setting upright=2 would be visible regardless. — kwami (talk) 07:11, 10 January 2023 (UTC)
- Oh, I bet I know what this is. This is a limitation in MediaWiki. If you start with a tiny image, it won't blow it up larger than its actual size. What's the example of upright not working? — hike395 (talk) 07:14, 10 January 2023 (UTC)
- I see that at e.g. Malay language, where the map is an SVG but the nominal size is only 257×190px. And indeed, the English map has a nominal size of 512×260px, which is probably what I was getting when I set the size to anything but a number. But the map at Arabic language is nominally 1200px, and 'upright' has no effect there either (neither map nor image). — kwami (talk) 07:20, 10 January 2023 (UTC)
- I'm a bit confused. File:Arabic albayancalligraphy.svg (the example image in the infobox) is 343px, so it won't get bigger than that. File:Arabic speaking world.svg is 1200px, but
|upright=appears to work (see below). — hike395 (talk) 07:30, 10 January 2023 (UTC)- Yeah, looks fine here, but no effect in the infobox. I just saved a test edit on that page, in case the preview wasn't working: nothing. — kwami (talk) 07:37, 10 January 2023 (UTC)
- I'm a bit confused. File:Arabic albayancalligraphy.svg (the example image in the infobox) is 343px, so it won't get bigger than that. File:Arabic speaking world.svg is 1200px, but
- I see that at e.g. Malay language, where the map is an SVG but the nominal size is only 257×190px. And indeed, the English map has a nominal size of 512×260px, which is probably what I was getting when I set the size to anything but a number. But the map at Arabic language is nominally 1200px, and 'upright' has no effect there either (neither map nor image). — kwami (talk) 07:20, 10 January 2023 (UTC)
- Oh, I bet I know what this is. This is a limitation in MediaWiki. If you start with a tiny image, it won't blow it up larger than its actual size. What's the example of upright not working? — hike395 (talk) 07:14, 10 January 2023 (UTC)
- No, but I would think that setting upright=2 would be visible regardless. — kwami (talk) 07:11, 10 January 2023 (UTC)
- @Kwamikagami: Have you tried changing your preference for thumbnail size away from 220px? — hike395 (talk) 07:09, 10 January 2023 (UTC)
- I think there was a misunderstanding. I didn't implement
|upright=in {{Infobox language}}: I just made the default have scalable thumbnails. In Template:Infobox language/sandbox I implemented|imageupright=and|mapupright=to work as you would think, see Template:Infobox language/testcases#Test upright for the results. — hike395 (talk) 09:43, 10 January 2023 (UTC)
- I think there was a misunderstanding. I didn't implement
- Ah, thank you. Yes, that works beautifully.
- I changed the labels to 'imagescale' and 'mapscale', as there's been some confusion that 'upright' is only used will tall images. — kwami (talk) 10:39, 10 January 2023 (UTC)
Updated strip marker
According to mw:Strip marker, the code for strip markers has changed. You need to replicate this change in order to get that code to work again. Strainu (talk) 20:58, 20 November 2023 (UTC)
- Implemented in the Module:InfoboxImage/sandbox, but none of the existing tests failed. What is this change supposed to accomplish? Is there a test case where the old code fails and the new one succeeds? — hike395 (talk) 01:15, 21 November 2023 (UTC)
- Yes, the change is supposed to allow {{Multiple images}} to be used with InfoboxImage: see the infobox at ro:Târgoviște. From what I can see, Template:Multiple images has the same implementation as on rowiki, so it's very likely to fail with the old implementation. Strainu (talk) 08:11, 21 November 2023 (UTC)
- Lines 178-180 already handle the updated format. It's just that lines 175-178 were not updated previously. -- WOSlinker (talk) 09:31, 21 November 2023 (UTC)
- Is it safe to simply delete lines 175-177? — hike395 (talk) 12:32, 21 November 2023 (UTC)
- Either would work, so I've applied the sandbox change and removed the other check. -- WOSlinker (talk) 13:27, 21 November 2023 (UTC)
- Added a test case using {{Multiple images}} (although it was not failing previously). — hike395 (talk) 19:42, 21 November 2023 (UTC)
- Either would work, so I've applied the sandbox change and removed the other check. -- WOSlinker (talk) 13:27, 21 November 2023 (UTC)
- Is it safe to simply delete lines 175-177? — hike395 (talk) 12:32, 21 November 2023 (UTC)
- Lines 178-180 already handle the updated format. It's just that lines 175-178 were not updated previously. -- WOSlinker (talk) 09:31, 21 November 2023 (UTC)
- Yes, the change is supposed to allow {{Multiple images}} to be used with InfoboxImage: see the infobox at ro:Târgoviște. From what I can see, Template:Multiple images has the same implementation as on rowiki, so it's very likely to fail with the old implementation. Strainu (talk) 08:11, 21 November 2023 (UTC)
Explicit option to not add image
This module is sometimes called by an infobox which passes on an image parameter if it's given in the call and otherwise automatically passes on a Wikidata image. If an article explicitly wants no image then it can pick one of the suppressed image names like image=No image available.png in [1] which uses {{Infobox dam}}. That was hard to work out, later editors of the article may blank the bad looking image parameter in good faith, and I don't know whether the list of suppressed images is certain to never remove a listed image name. I suggest adding a clear and simple value |image=no to not display any image. A blank |image= already does this but as mentioned, that doesn't work in some calls of infoboxes. I came here after working on Wikipedia:Teahouse#Technical question about infobox. PrimeHunter (talk) 12:09, 1 December 2023 (UTC)
- Should all instances of a nested {{Infobox dam}} disable the image? If so, the fix is straightforward in that template. Gonnym (talk) 12:21, 1 December 2023 (UTC)