Page MenuHomePhabricator

File page: 'Other resolutions' (wgImageLimits) does not match actual linked resolutions (wgThumbnailSteps)
Closed, ResolvedPublic

Description

On an image page, we have $wgImageLimits that generate:

Other resolutions: 320 × 240 pixels | 640 × 480 pixels | 800 × 600 pixels | 1,280 × 960 pixels | 2,560 × 1,920 pixels | 4,032 × 3,024 pixels.

For WMF wikis these currently return different resolutions, namely: 340px, 960px, 1280px and 2560px
This is because of T360589 which added wgThumbnailSteps

We now have differing wgImageLimits, wgThumbnailSteps and wgMediaViewerThumbnailBucketSizes, all with differing values which is of course confusing, but image limits in particular being presented in the UI seems problematic.

Event Timeline

Krinkle renamed this task from File page: 'Other resolutions' (wgImageLimits) does not match actual linked resolutions (wgThumbnailStepsRatio) to File page: 'Other resolutions' (wgImageLimits) does not match actual linked resolutions (wgThumbnailSteps).May 19 2026, 4:43 PM
Krinkle updated the task description. (Show Details)

Change #1289394 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/core@master] FilePage: apply getNormalizedThumbLimits for "other resolutions" download links

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

Change #1282414 had a related patch set uploaded (by Simon04; author: Simon04):

[mediawiki/core@master] FilePage: apply getNormalizedThumbLimits for "other resolutions" download links

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

Change #1289394 abandoned by Simon04:

[mediawiki/core@master] FilePage: apply getNormalizedThumbLimits for "other resolutions" download links

Reason:

https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1282414

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

While this issue is being fixed, may I suggest that the resolutions offered to the user should be rationalized to be more in line with existing screen sizes (e.g. Full HD, i.e. 1920x..., 4K, i.e. 3840x...) instead of 1280x..., 2560x... or should I perhaps suggest this in a separate feature request?

The standards for which files we serve already been defined (https://www.mediawiki.org/wiki/Common_thumbnail_sizes). While those can evolve over time, it requires a fair amount of weight and consideration to add new sizes at this point (because it's expensive, and can have a wide impact on infrastructure and client-side performance).

What we can do is change the labels. This task is about fixing the existing labels to at least correctly state the size of the files in question (i.e. post-normalization instead of pre-normalization).

Associating custom labels with certain pixel sizes is possible, but is better explored in a new task. You can actually alreado do this today through wikitext in the show-big-image-size interface message with a combination of {{#switch}} or {{#if:}}. That might be a good way to experiment first. I suggest discussing this at https://commons.wikimedia.org/wiki/Commons:Village_pump/Technical.

If you end up with something that the community is happy with, and encounter no issues for a few weeks, we could consider adding something default in MediaWiki for this.

Change #1282414 merged by jenkins-bot:

[mediawiki/core@master] FilePage: apply getNormalizedThumbLimits for "other resolutions" download links

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

Change #1319942 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/core@master] FilePage: don't bucket-round the size label for an unrendered original

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

[mediawiki/core@master] FilePage: don't bucket-round the size label for an unrendered original

This was reported on Commons. I was surprised that originals are in there to begin with, but apparently this is a conscious decision that was made over 15 years ago.

[edit] it seems that https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1317589 also deals with this problem and possibly more. It should probably have precedence.

Change #1319942 abandoned by TheDJ:

[mediawiki/core@master] FilePage: don't bucket-round the size label for an unrendered original

Reason:

in favor of I33c4dbc4280814d5f1753498aed52481d04c0873

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