Template talk:Gallery

Question on default width / height
Hello,

Module:Gallery contains the following lines:

gargs['widths'] = tonumber(args.width) or 180 gargs['heights'] = tonumber(args.height) or 180

That sure makes it sound like the default width / height for traditional galleries is supposed to be 180x180. However, this is not actually true. Either gargs isn't being used at all, or else some other bit of parsing later on down the line throws it out, because the default gallery size end up being 120x120 if no width / height arguments are passed in. Is this a bug, or a feature? Where is the step that actually changes an unset widths / heights to 120?

(Context: I'm considering starting an RFC to change the default to something larger, but would like to know the technical constraints first. Maybe there's some deep issue with doing that or other problem to be aware of.)  SnowFire (talk) 03:33, 9 September 2023 (UTC)


 * To partially answer my own question: https://www.mediawiki.org/wiki/Manual:$wgGalleryOptions suggests that 120 is the default value at a MediaWiki-wide setting (confirmed at https://github.com/wikimedia/mediawiki/blob/master/includes/SetupDynamicConfig.php#L115-L123 ). So what is this gallery args default doing, anyway?  If it was supposed to be setting widths & heights to 180 if unset, it's clearly not doing its job.  Is this just a bug if 180x180 was always intended for English Wikipedia?  (Note that I'm asking here because Module talk:Gallery redirects here...)  If this functionality is bugged, that implies we need to go set the wgGalleryOptions at a lower config level rather than merely modify the Module code.  SnowFire (talk) 18:06, 13 September 2023 (UTC)
 * Before you start an RFC, you might consider requesting that a module editor modify the sandbox of this module, or other modules or code on which it depends, in a way that provides for a larger default image. As you appear to have deduced, starting an RFC could be a waste of time if it turns out that changing the default size is not possible. – Jonesey95 (talk) 19:41, 13 September 2023 (UTC)
 * Are we sure that you are talking about ? Here is a comparison between  and, both in minimal form:
 * Using , these images render at 120×89 and 95×120:
 * Using , these images render at 120×89 and 95×120:
 * Using, these images render at 182×135 and 144×182:
 * —Trappist the monk (talk) 21:44, 13 September 2023 (UTC)
 * I'm talking about, not the template version. I'm asking here because, as noted above, Module talk:Gallery redirects to this Template talk page, so I presume this is intended to be the one place for gallery talk.  The fact that the gallery tag has a different default than the template is...  not good and surprising in a bad way, I don't think editors expect that.  (Also as a slight nitpick, it's 180 not 182.)  If this was unintentional, than it sounds like the Module is bugged if it's supposed to be using the same 180 as default.
 * How exactly would I force an edited sandbox version to be used, though? Apologies if it's a dumb question, but I haven't ever attempted to force a Sandbox module to be used rather than the default SnowFire (talk) 03:02, 14 September 2023 (UTC)
 * OK, now I'm confused. What is your goal? – Jonesey95 (talk) 13:25, 14 September 2023 (UTC)
 * The extra 2px is the 1px boarder applied by the module with the  css class (Module:Gallery/styles.css line 76).
 * At Module:Gallery line 112 is this:
 * For my example gallery, that line creates a  tag that looks like this:
 * Module:Gallery is overriding the 120px  tag default. If you want to change the  tag default, this template/module is not the place to do it.  Perhaps en.wiki has a configuration switch that can be changed increase  tag default height/width.  You might ask at WP:VPT.
 * —Trappist the monk (talk) 14:38, 14 September 2023 (UTC)
 * Jonesey95: I'm trying to see what would be required to change the default behavior of the gallery tag, not the template.
 * Trappist: So you're basically saying that the Module doesn't control the Gallery tag behavior at all, just this template? I see.  Thanks for the information.  (And yes, I know about the borders, but you said "these images render at 182×135" which sounded like you meant, well, the image itself.)  SnowFire (talk) 18:59, 14 September 2023 (UTC)
 * It sounds like you want to post at Help talk:Gallery tag. When you visit there, you may come across a link to this discussion, where, unfortunately, two changes were proposed at the same time, and one of them was opposed strongly, so the size increase did not happen. – Jonesey95 (talk) 20:55, 14 September 2023 (UTC)
 * I'm afraid I came here from Help talk:Gallery tag, as you can see I already opened a section there awhile back ("Galleries, part 2"). I was under the impression that the Module code was where the tech-ier side lived hence asking here, but seems like that's not the case.  And yes, I'm familiar with the earlier RFC, I'm referring to potentially running a second RFC strictly on size and not on packed vs. traditional, as noted on the linked talk page.  I guess I'll keep looking to find where the config file used lives.  SnowFire (talk) 15:51, 15 September 2023 (UTC)
 * Perhaps this setting: mw:Manual:$wgGalleryOptions
 * —Trappist the monk (talk) 18:30, 16 September 2023 (UTC)
 * I'm familiar - it's linked in my second comment above. Hence why I said the real question is who to talk to change this and where the current config file for English Wikipedia is stored.  SnowFire (talk) 00:02, 17 September 2023 (UTC)
 * Module:Gallery is the underlying code of Template:Gallery, and this is the talk page for both. Their code is not used by , which is an extension to the MediaWiki software. Changes to the latter are discussed at Help talk:Gallery tag. -- Red rose64 &#x1f339; (talk) 21:47, 17 September 2023 (UTC)
 * Perhaps this setting: mw:Manual:$wgGalleryOptions
 * —Trappist the monk (talk) 18:30, 16 September 2023 (UTC)
 * I'm familiar - it's linked in my second comment above. Hence why I said the real question is who to talk to change this and where the current config file for English Wikipedia is stored.  SnowFire (talk) 00:02, 17 September 2023 (UTC)
 * Module:Gallery is the underlying code of Template:Gallery, and this is the talk page for both. Their code is not used by <gallery ></gallery>, which is an extension to the MediaWiki software. Changes to the latter are discussed at Help talk:Gallery tag. -- Red rose64 &#x1f339; (talk) 21:47, 17 September 2023 (UTC)

Adjusting margins between images
See the discussion here: is it possible to remove the empty spaces between images in a gallery tag in "packed" mode? Jarble (talk) 16:07, 21 September 2023 (UTC)

Can I Use the Pie Chart Template inside of this Template?
I am trying to make 2 pie charts be right next to eachother, they are the same size. Can i use Template:Pie chart inside of the gallery template? 😎😎PaulGamerBoy360😎😎 (talk) 15:54, 14 December 2023 (UTC)
 * I don't think so. You might have luck with Image frame. – Jonesey95 (talk) 19:31, 14 December 2023 (UTC)

Fix paddings for header and footer
Last year the &lt;gallery> tag dropped large margin at the left side, and make use of  unit instead to produce more compact view. So this template need to update to follow on. In this template I made changes for these three classes:,  ,. You can see the changes here, and you can also see the effects on c:Template:Gallery. -- Great Brightstar (talk) 16:37, 10 June 2024 (UTC)
 * ✅ * Pppery * <sub style="color:#800000">it has begun... 02:03, 9 July 2024 (UTC)