Page MenuHomePhabricator

Images are vertically squeezed when editing in the Page namespace
Closed, ResolvedPublicBUG REPORT

Description

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

What happens?:

The images are vertically squeezed.

What should have happened instead?:

The image should preserve its aspect ratio.

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

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

Event Timeline

I'm affected by this problem, and here are some more information:

  • As part of the problem, the header and footer become excessively bloated;
  • Previously the page editor should also adjust itself with different sizes of pages, now it is nonfunctional (i.e. I have to scale the size of the page editor manually to remove excessive spaces);
  • It appears to be affecting English Wikisource only, at least the problem doesn't exist on Chinese Wikisource (example).
  • The problem was discussed at English Wikisource. Some claimed this bus is in fact an intentional update. Is it true?
  • As part of the problem, the header and footer become excessively bloated;

This is probably unrelated and also intentional.

  • Previously the page editor should also adjust itself with different sizes of pages, now it is nonfunctional (i.e. I have to scale the size of the page editor manually to remove excessive spaces);

This is a direct result of the image squeezing. The editor size is set automatically as before

  • It appears to be affecting English Wikisource only, at least the problem doesn't exist on Chinese Wikisource (example).

No, this issue is not unique to English Wikisource, but the degree of vertical squeezing seems different for different Pdf images.

When I was trying a few pages at another index, the page images are just gone, leaving a message "Failed to initialize OpenSeadragon, no image found." (see e.g. page 2). The file page also shows "Error creating thumbnail: Invalid thumbnail parameters" for the faulty pages.

Note that the entire PDF document is not affected—just the page thumbnails.

I'm not sure if this is related, but as both relate to faulty thumbnail images, I'll make a mention (sorry for digressing if it is irrelevant to the problem). T299521 might also be useful?

This vertical squeezing appears also with single JPG images, like here: https://de.wikisource.org/w/index.php?title=Seite:Meyers_b13_s0656.jpg&action=edit
The scan becomes nearly unreadable. Please fix this somehow.

Bhsd renamed this task from Pdf images are vertically squeezed when editing in the Page namespace to Images are vertically squeezed or missing when editing in the Page namespace.Mar 14 2026, 2:59 PM
Bhsd updated the task description. (Show Details)

Thanks for sharing more cases! I have updated the task description.

Update: Some files are not affected. For example, take this page from the British North America Act 1867, and you'll find it's not squeezed.

Hopefully a possible breaking point, but it seems that the affected and unaffected files have the same PDF version (v. 1.4) and software used.

I think the squeezing issue is caused by a wrong width property of the original <img> tag which is lower than the actual image width. In the first two cases listed in the task description, the actual image widths are both 500px, but the width properties of the corresponding <img> tag are 879 and 800, respectively.

Update: Some files are not affected. For example, take this page from the British North America Act 1867, and you'll find it's not squeezed.

It is also squeezed slightly. The actual image width is 960px while the width property of the <img> tag is 991.

Change #1253567 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/ProofreadPage@master] OpenseadragonController: use image natural dimension

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

I have submitted a patch to fix the squeezing issue. It is demonstrated on Patch demo: before and after the proposed fix.

Bhsd renamed this task from Images are vertically squeezed or missing when editing in the Page namespace to Images are vertically squeezed when editing in the Page namespace.Mon, Mar 16, 5:11 PM
Bhsd changed the task status from Open to In Progress.
Bhsd claimed this task.
Bhsd updated the task description. (Show Details)

Change #1253567 merged by jenkins-bot:

[mediawiki/extensions/ProofreadPage@master] OpenseadragonController: use image natural dimension

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

Bhsd removed a project: Patch-For-Review.

In addition to the JavaScript fix, the wrong <img> width has also been fixed from PHP side (r1253467).