Page MenuHomePhabricator

"Other resolution" is wrongly omitted for images under or equal to 800px wide
Closed, ResolvedPublic

Assigned To
Authored By
Krinkle
Mar 27 2026, 10:40 PM
Referenced Files
F74716218: Screenshot A.png
Apr 1 2026, 7:17 AM
F74716217: Screenshot B.png
Apr 1 2026, 7:17 AM
F73863743: Screenshot 2026-03-27 at 15.21.19.png
Mar 27 2026, 10:40 PM
F73863788: Screenshot 2026-03-27 at 15.36.11.png
Mar 27 2026, 10:40 PM
F73863712: Screenshot 2026-03-27 at 15.29.04.png
Mar 27 2026, 10:40 PM
F73863731: Screenshot 2026-03-27 at 15.29.37.png
Mar 27 2026, 10:40 PM

Description

Background

Generaly speaking, the file description page provides:

  • Link to and information about the 800x600px preview (its width/height, and file type if different from original, e.g. PNG for SVG, JPG for TIFF). This is determined by $wgImageLimits, taking the optoin set by the imagesize preference. This defaults to 800x600px. If the original is web safe, and if it is equal or smaller than 800x600px, then we use the original as the preview, no image scaling.
  • Links to other sizes: 320px, 640px, 800px, 1024px, 1280px, 2560px. This is again $wgImageLimits, adjusted as needed based on portrait/landscape orientation, omitting the size of the preview, and omitting anything larger than the original size as we deny needless upscaling.
  • Link to download the original, regardless of size or type.

Examples:

https://commons.wikimedia.org/wiki/File:Adam_Simmons,_Swaffham_Raceway,_2017-03-11.JPG

Screenshot 2026-03-27 at 15.29.37.png (1,836×190 px, 158 KB)

https://commons.wikimedia.org/wiki/File:Example.svg

Screenshot 2026-03-27 at 15.29.04.png (1,960×186 px, 64 KB)

Problem

https://commons.wikimedia.org/wiki/File:CorusSteelworks.jpg

... provides no links to any other resolutions, saying only:

No higher resolution available.

Screenshot 2026-03-27 at 15.36.11.png (1,806×192 px, 106 KB)

Where are the links to the 320px and 640px sizes?

There appears to be an inconsistency where feature that is provided is presented as "Other resolutions" when it is active. But when it is inactive, it claims that what it wil provide is "Higher resolutions".

Perhaps this was true once upon of time, I can see how maybe the default used to be the first entry of $wgImageLimits, and later the imagesize preference got introduced defaulting to the third entry? Thus losing the first two links for images under that threshold.

Other info

This came up in context of the Stockphoto gadget on Wikimedia Commons. It is failing to provide "Use this on the web" instructions because these links are missing for images such as this one:

https://commons.wikimedia.org/wiki/File:Ravenscar_-_geograph.org.uk_-_401270.jpg

Screenshot 2026-03-27 at 15.21.19.png (1,948×462 px, 771 KB)

Discussion: https://commons.wikimedia.org/wiki/Commons:Village_pump/Technical#c-Bawolff-20260327090800-Jmabel-20260325053700

I'm working on a workaround for the gadget, but this seems like a bug we should fix more generally as well.

Event Timeline

Change #1262354 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] ImagePage: Enable "Other resolutions" for images below preview size

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

Krinkle renamed this task from "Other resolution" is wrongly omitted for images between 240px and 640px wide to "Other resolution" is wrongly omitted for images between 240px and 800px wide.Mar 27 2026, 10:59 PM
Krinkle renamed this task from "Other resolution" is wrongly omitted for images between 240px and 800px wide to "Other resolution" is wrongly omitted for images under or equal to 800px wide.

Change #1262354 merged by jenkins-bot:

[mediawiki/core@master] ImagePage: Enable "Other resolutions" for images below preview size

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

From the task description:

Fix verified in the Beta Cluster:

Screenshot B.png (1,078×244 px, 142 KB)

Screenshot A.png (956×288 px, 351 KB)