Page MenuHomePhabricator

PageImages aren't showing in PagePreview for some articles
Open, MediumPublic2 Estimated Story PointsBUG REPORT

Description

Steps to replicate the issue:

What happens?:

  • The 2nd cast member ("Sonya Walger") does not have an image in their PagePreview
  • Only the 4th cast member does ("Jake Weber").

What should have happened instead?:

  • An image should be shown for Sonya Walger

Other information:

image.png (525×339 px, 52 KB)

image.png (587×405 px, 147 KB)

Event Timeline

I think they were discarted because they were too small, but I can't be sure. Also most Italian former deputies have a small image retrieved from dati.camera.it (i.e. File:Mauro Scoccimarro (1946).jpg for Mauro Scoccimarro) that are not selected in PagePreview but associated in the pageimage field of the corresponding Page Information card (see https://it.wikipedia.org/w/index.php?title=Mauro_Scoccimarro&action=info).

Jdlrobson subscribed.

Yes the issue is the resolution of the image. Page previews requires a thumbnail of at least 640px in size to render since 83c528c7e. I don't see any evidence that we have ever rendered any image lower than 320 * window.devicePixelRatio (https://github.com/wikimedia/mediawiki-extensions-Popups/blame/master/src/gateway/rest.js#L162 is the bit of code that disables it)? Related: T272169: Regression: Page-Previews seem to be blurred for thumbnails with natural height less than 200px.

(The image is present in https://en.wikipedia.org/api/rest_v1/page/summary/Jewish_partisans and https://en.wikipedia.org/api/rest_v1/page/summary/Mukden incident and en.wikipedia.org/wiki/Mukden incident?action=info regardless of this constraint)

This is documented on https://www.mediawiki.org/wiki/Extension:Popups#Known_problems and I suspect what has happened is people now have better screen quality and are hitting this snag.

Note 10 years ago, 320px was enough to see a page preview on an image, now if a browser supports 2 device pixels, 640px is required to avoid blur.

Change #1343628 had a related patch set uploaded (by Thilio; author: Thilio):

[mediawiki/extensions/Popups@master] REST gateway: Handle image URLs with query parameters

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

It is written that a portrait image should have a exact (min) height 250 px & max width 203 px. How should I read and use this requirement and check if a portrait image respect it? It's not very clear.

I remember that the it.wiki page Enrico Berlinguer used to have an associated PageImage (File:Enrico Berlinguer.jpg), that is 492×651px.

@Krinkle would you be able to identify what might've happened in the WE5.4.12 work that could be causing this bug? appreciate any insight you can give on root cause here, thanks!

There is already a patch uploaded above 8 days ago, pending code review by maintainers of the Popups extension.

The various comments above already determined a root cause. This is trivial to verify for any engineer by testing Popups today and seeing the code flow in dev tools.

That other task was mentioned, I believe to show since when and why file URLs have query parameters (not to show how it works, because Popups does not directly call the code modified in that task, so understanding that won't help here.)

My recommendation would be to, after a quick fix, revisit this code. Popups is duplicating business logic and relies on undocumented behaviour, causing this bug. There should be no reason for Popups client code to manipulate the URL. I believe you can refactor it away. Doing so will insulate you from further unannounced breakage in the future.

SherryYang-WMF lowered the priority of this task from High to Medium.Oct 6 2026, 4:28 PM
SherryYang-WMF set the point value for this task to 2.Oct 6 2026, 4:31 PM

@mfossati I think this is pretty bad so if @Thilio is occupied I'd recommend we help driving that fix. While testing this I realized that since we switched to Parsoid local development is a bit more challenging with MobileContentProvider so I created https://gerrit.wikimedia.org/r/c/mediawiki/extensions/Popups/+/1357765 to help us test this better.