Page MenuHomePhabricator

Change size for gallery previews for sv.wp to 150px
Closed, ResolvedPublic

Description

per consensus (https://sv.wikipedia.org/wiki/Wikipedia:Bybrunnen#St.C3.B6rre_storlek_p.C3.A5_miniatyrbilder_i_gallerier and https://sv.wikipedia.org/wiki/Wikipediadiskussion:Gallerier) the images should be changed from 120px to 150px (in LocalSettings.php) on sv.wp in galleries.

Event Timeline

Josve05a raised the priority of this task from to Needs Triage.
Josve05a updated the task description. (Show Details)
Josve05a subscribed.

Unless there's already a setting for this, you need one ticket against MediaWiki-Gallery to get a setting created to allow for it, and a separate ticket against Wikimedia-Site-requests to get it set on svwiki.

The task to implement the ability to change the default image size in <gallery> is T3340. Unfortunately it is currently impossible.

matmarex changed the task status from Open to Stalled.Sep 27 2015, 2:18 PM
matmarex set Security to None.
matmarex unsubscribed.

@matmarex Are you sure that marking is correct? We are not discussing changing it for individual users, its a discussion about changing it in LocalSettings for a specific project, why cant that be done?

matmarex changed the task status from Stalled to Open.Sep 27 2015, 2:36 PM

Whoops, I'm sorry, it seems that it is indeed possible to set it for the whole wiki using $wgGalleryOptions. I wasn't aware that this option exists. Thank you for catching it :)

Whoops, I'm sorry, it seems that it is indeed possible to set it for the whole wiki using $wgGalleryOptions. I wasn't aware that this option exists. Thank you for catching it :)

Can't find that variable in the config files. Where is it suposed to be hosted? Or it's the only project so far that have requested this?

I've found at limits to configuration changes that a similar request was filled for hewiki a while ago and was declined for Performance-Team reasons. Task was T43712.

Sure thing, I'll take a look at that.

For width-constrained images:

150px should be fine performance-wise, as 150px, 225px (1,5x) and 300px (2x) are all highly requested sizes already (they're all in the top 30 most requested thumbnail widths).

Less requested than 120px (whose variants are in the top 5 most requested widths), but I don't expect a major impact here.

For height-constrained images:

Performance is already sub-optimal for those because we rarely constrain by height like galleries do, but that's more an issue with our thumbnail url format than with galleries per se. However, moving to a new default width constraint for galleries now does mean that the cache miss likelihood for height-constrained images is going to see a sudden increase. The extent to how bad this is depends on the quantity of images displayed in svwiki galleries that haven't been displayed in a 150px gallery before. Anecdotally, I was looking for galleries on Commons and quickly found some whose width had been set to 150px (apparently this is possible via a parameter on the gallery tag).

@Josve05a are galleries on svwiki usually local uploads, or images hosted on commons? Could you give me links to "typical" and high traffic galleries on svwiki? Do you know if it's possible to estimate how many images are in galleries on svwiki?

@Gilles (on iPhone now, so apologies for incomplete answers)
Svwp does not have local uploads, only images from Commons.
I know that the bot Lsjbot (ran by User:Lsj) adds galleries if unsure which images to add to the Infobox. (The bot has created 2-3 million articles, say 1/20 of those has a gallery which average about 3 images each.) all those numbers are just fictional and may be completely way off, but gives a rough estimate.
I'm not sure which article has most galleries, sorry

If I did this right:

synology> cat svwiki-latest-pages-articles.xml | grep '&lt;gallery' | wc -l
76848

That's how many galleries there are currently on svwiki. I'll see if it's easy enough to parse in the command line to figure out the unique image count.

Ok :) Yeah, I just took number from the air, that's most likely a better way to find out the real number :)

This time, trying to figure out how many distinct images are in galleries:

synology> sed -n '/&lt;gallery/,/&lt;\/gallery/p' svwiki-latest-pages-articles.xml | grep -v '&lt;/gallery&gt;' | grep -v '&lt;gallery' | sed 's/^Bild:\s*//' | sed 's/^File:\s*//' | sed 's/^Fil:\s*//' |
 sed 's/^Image:\s*//' | sed 's/|.*$//' | sed -e /^$/d | sort | uniq | wc -l
284776

This doesn't look too bad. I'll pick a sample and check the ratio of images that already have the required sizes generated.

That's an average of 3.7 (unique) images per gallery, your estimation wasn't too far off!

That's an average of 3.7 (unique) images per gallery, your estimation wasn't too far off!

Ok, my estimation skills are on fleek!

Change 304991 had a related patch set uploaded (by Gilles):
Update gallery image bounding box on svwiki to 150x150

https://gerrit.wikimedia.org/r/304991

Change 304991 merged by jenkins-bot:
Update gallery image bounding box on svwiki to 150x150

https://gerrit.wikimedia.org/r/304991

Seems like this was deployed back in January?