Page MenuHomePhabricator

Default thumbnail size does not change image size on the page
Closed, ResolvedPublicBUG REPORT

Description

Changing default thumbnail size in user preferences should change image size on the page. It does happen in page preview, but it does not happen on the page itself. The image size on the page can no longer be controlled via user preferences.

This issue appeared in Russian Wikivoyage yesterday (16.04), and it seems to be generic across different projects. Note that it does not appear until page cache is purged.

Concrete example:
https://ru.wikivoyage.org/wiki/Лодзь
Here, all images are supplied with the upright= parameter to allow image size control via user preferences. However, it does not work.

Event Timeline

Atsirlin triaged this task as Medium priority.Apr 17 2025, 5:57 AM

This is likely due to parsoid rendering being active for the user, where possible before it was not enabled for that user ? See also T375981

@TheDJ: the symptoms indeed look similar, thank you for the hint! But how does one set the default thumbnail size in Parsoid? Or is it hard-coded and unchangeable?

@Arlolra notes that this CSS/JS solution also doesn't scale images which use the upright option ( https://www.mediawiki.org/wiki/Help:Images#Syntax ). That's not a regression -- we didn't scale those thumbnails before because we didn't scale any thumbnails -- and might be something we address with a new wikitext option, like square. CF Add a new image option: "square" (120856), T351: RfC: Square bounding boxes, T65903: Thumbnails should use a square bounding box by default, T37756: Image parameter for thumbs that scale to an exact box, cropping as necessary, T65904: The 'upright' option should use a square bounding box, T9003: Allowthumbnail size of an image to be defined as proportion of the user's default, etc.

https://en.wikipedia.org/wiki/Wikipedia:Image_use_policy#Displayed_image_size is relevant, too.

It might be that a JS intersection observer is necessary to handle the arbitrary scaling possible with 'upright'.

@cscott it seems from this bug report that upright does have some kind of support.. but it doesn't match the preference. From what I can see it sets height on the image instead of width. This setting does seem problematic in that it can result in much larger thumbnails. Perhaps it would be better to ignore the upright setting in Parsoid's output so at least they scale with the user preference?