Page MenuHomePhabricator

Images with an original size less than 400px are scaled up by large thumbnail preference
Open, LowPublicBUG REPORT

Assigned To
Authored By
Jdlrobson-WMF
Mar 27 2026, 5:47 PM
Referenced Files
F87767296: firefox ESR #1.png
Wed, Jun 10, 8:42 AM
F87767298: firefox ESR #2.png
Wed, Jun 10, 8:42 AM
F87767300: firefox ESR #3.png
Wed, Jun 10, 8:42 AM
F87767304: firefox ESR #4.png
Wed, Jun 10, 8:42 AM
F87767940: IMG_0680.jpeg
Wed, Jun 10, 8:42 AM
F87767941: IMG_0681.jpeg
Wed, Jun 10, 8:42 AM
F87767942: IMG_0682.jpeg
Wed, Jun 10, 8:42 AM
F87767943: IMG_0683.jpeg
Wed, Jun 10, 8:42 AM

Description

Steps to replicate the issue (include links if applicable):

What happens?:
The image gets stretched as it's not clear from the markup that the image is unscaleable.

What should have happened instead?:
It should not scale.

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):

Event Timeline

If srcset was blank for this image we could add the rule:

html.skin-theme-clientpref-thumb-large .mw-parser-output[data-mw-parsoid-version] .mw-default-size img[width="250"]:not([srcset]) {
    width: 100%;
}

@cscott please let me know if you want to empty the srcset of redundant values like we do in legacy and I can help with the CSS part.

Change #1267281 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Skin: Avoid stretching low resolution images

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

Change #1267281 merged by jenkins-bot:

[mediawiki/core@master] Skin: Avoid stretching low resolution images

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

Change #1275529 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] Revert "Skin: Avoid stretching low resolution images"

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

We are reverting this patch based on feedback. A blurry image is more obvious than a non-blurry one.

Change #1275540 had a related patch set uploaded (by C. Scott Ananian; author: Jdlrobson):

[mediawiki/core@wmf/1.46.0-wmf.24] Revert "Skin: Avoid stretching low resolution images"

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

Change #1275529 merged by jenkins-bot:

[mediawiki/core@master] Revert "Skin: Avoid stretching low resolution images"

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

Change #1275540 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.24] Revert "Skin: Avoid stretching low resolution images"

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

Mentioned in SAL (#wikimedia-operations) [2026-04-20T23:10:39Z] <jdlrobson@deploy1003> Started scap sync-world: Backport for [[gerrit:1275540|Revert "Skin: Avoid stretching low resolution images" (T421524 T423676)]]

Mentioned in SAL (#wikimedia-operations) [2026-04-20T23:12:21Z] <jdlrobson@deploy1003> cscott, jdlrobson: Backport for [[gerrit:1275540|Revert "Skin: Avoid stretching low resolution images" (T421524 T423676)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-04-20T23:16:36Z] <jdlrobson@deploy1003> Finished scap sync-world: Backport for [[gerrit:1275540|Revert "Skin: Avoid stretching low resolution images" (T421524 T423676)]] (duration: 05m 56s)

This bug impacts:

  • All images using upright that are < 400px original size (for all modes: small, regular, large)
  • Images that are > 250px which are viewed in large
  • Large upright values e.g. you have an image original size 800px, but you are doing [[File:Name.jpg|thumb|upright=5]] which is 5*400 = 2000px for people with the thumbnail preference.

This could be fixed to some degree by adding a class mw-file-low-resolution to any image which is less than 400px original size.

Then:

  • we'd limit the large size to only apply to 250px images without the mw-file-low-resolution class
  • We'd disable upright variable for all images with the class mw-file-low-resolution - they wouldn't be scaleable. This does mean you can't convert a 300px original size image to 150px using upright=0.5 but I think that's a fair compromise.

I would definitely prefer the images to not be upscaled. There are many non-free and small-res images on wikis, which don't look their best when scaled above their native resolution. The behavior I come to expect and enjoy is using the size of the image, capped to a width of 400px.

Change #1286443 had a related patch set uploaded (by Jdlrobson; author: Jdlrobson):

[mediawiki/core@master] POC: Add data-low-resolution to low resolution images

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

@cscott above is a proof of concept to show how this would work in legacy parser (and for testing)

Jdlrobson-WMF renamed this task from Small images are scaled up by thumbnail preference to Images with an original size less than 400px are scaled up by large thumbnail preference.Thu, May 14, 6:17 AM
Jdlrobson-WMF updated the task description. (Show Details)
Jdlrobson-WMF added a subscriber: gh87.

@Jdlrobson-WMF Any updates on this? I really would like to see photos in their high quality-ness :)

@Jdlrobson-WMF Any updates on this? I really would like to see photos in their high quality-ness :)

No updates (if so you'll see them here). To set expectations, the images in question do not have high-res versions so a fix here won't improve that. At best it will result in these images will always display at standard thumbnail size rather than a stretched large.

So, I realize now this issue pertains to images being forced to be larger than they are. For me, all images are being upscaled, no matter the original resolution. For instance on Gracie Abrams, the file Gracie Abrams performing at Kamala Harris presidential campaign rally at Alliant Energy Center in Madison, Wisconsin on October 30, 2024 IMG 9880.jpg is being delivered at 250px, and then upscaled to 400px in the browser. Look at how it appears:

image.png (426×378 px, 315 KB)

So, I realize now this issue pertains to images being forced to be larger than they are. For me, all images are being upscaled, no matter the original resolution. For instance on Gracie Abrams, the file Gracie Abrams performing at Kamala Harris presidential campaign rally at Alliant Energy Center in Madison, Wisconsin on October 30, 2024 IMG 9880.jpg is being delivered at 250px, and then upscaled to 400px in the browser. Look at how it appears:

image.png (426×378 px, 315 KB)

Omffphh thanks for flagging! Looks like a new regression unrelated to this bug (tracked in T427237)

As I noticed, upright may no longer work properly?

  • When I entered between 0.5 and 0.99, the size is the same.
  • When I entered between 0.2 and 0.49, the size is perhaps the same smaller size
  • When I entered 0.1, the size is perhaps smaller than above but not variable

As I noticed, upright may no longer work properly?

  • When I entered between 0.5 and 0.99, the size is the same.
  • When I entered between 0.2 and 0.49, the size is perhaps the same smaller size
  • When I entered 0.1, the size is perhaps smaller than above but not variable

I can confirm upright is currently working as expected.

If you are not seeing it work either:

  1. You are using an old or a legacy browser (e.g. Firefox ESR) where upright is not guaranteed to work.
  2. You are rendering an image with an original size less than 400px.
  3. Your skin is capping the width to the fully available width.

Do any of these apply? If not please share the browser and page you are using and I can take a look. If the page https://en.wikipedia.org/wiki/User:Jon_(WMF)/T420657 doesn't render correctly for you it is likely to be #1.

Do any of these apply?

Oh... One of my laptops uses Firefox ESR 115 on Windows 7 SP1 at this time. So far, the ESR 115 has been receiving updates lately until August 2026: https://support.mozilla.org/en-US/kb/firefox-users-windows-7-8-and-81-moving-extended-support

Giving the ESR 115 further updates thereafter has not yet been decided.

On the other hand, the upright works on iPadOS 26 via my iPad

Desktop view on Safari via iPadOS 26.5:

IMG_0683.jpeg (2,160×1,520 px, 605 KB)
IMG_0682.jpeg (1,115×1,620 px, 332 KB)
IMG_0681.jpeg (904×1,620 px, 253 KB)
IMG_0680.jpeg (827×1,620 px, 180 KB)

Desktop view on Firefox ESR via Windows 7:

firefox ESR #4.png (1,326×597 px, 1 MB)
firefox ESR #3.png (626×607 px, 463 KB)
firefox ESR #2.png (442×604 px, 244 KB)
firefox ESR #1.png (530×603 px, 180 KB)

That makes sense. Firefox ESR 115 is security only maintenance so is not keeping up with new features. @gh87 I've reopened T424596: Firefox 115esr doesn't support thumbnail sizes or upright parameter which tracks the specific bug you are flagging.