Page MenuHomePhabricator

Image resizing broken when image is too large to be thumbnailed
Open, LowPublic

Description

Author: imslproject

Description:
The image display size sent to the browser is incorrect when the image is not
thumbnailed. A test page for this can be found here:
[http://en.wikipedia.org/wiki/User:Feldmahler]

The first image should be resized to fit into a 500x200 box, but instead it is resized
to fit outside a 500x200 box. In other words, the image ''minimal'' size becomes
500x200 instead of the ''maximum'' size. The specification calls for the
<nowiki>[[Image:Foo.bar|123x456px]]</nowiki> format to mean the maximum size and not
the minimum size: [http://en.wikipedia.org/wiki/Wikipedia:Extended_image_syntax#Size]


Version: 1.10.x
Severity: normal

Details

Reference
bz9534

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:42 PM
bzimport set Reference to bz9534.
bzimport added a subscriber: Unknown Object (MLST).

If I'm not mistaken, the issue here is that the image isn't getting thumbnailed
server-side due to its large pixel size;
due to problems with resizing large PNG images, we have server-side resizing
disabled for very large PNG images.

Then, in the code path for displaying images scaled client-side, the box-fitting
scaling mode doesn't appear to be treated correctly: only the width parameter is
taken into account, rather than the width and height specified for the box.

imslproject wrote:

Actually, I already knew from some devs talking to me on IRC that images larger
than 12MP are not thumbnailed; I'm fine with that :) The problem is the second
issue you were talking about, with the height not taken into account.

Moved to the 'JavaScript' component. It doesn't seem to be a parser bug, it seems to be a bug in the client-side javascript scaling.

There is no such thing as "client-side javascript scaling" in core MediaWiki, as far as I know.

cscott renamed this task from Image resizing broken when image is not thumbnailed to Image resizing broken when image is too large to be thumbnailed.Feb 26 2015, 7:52 PM
cscott edited projects, added MediaWiki-File-management; removed MediaWiki-General.
cscott set Security to None.

The user's test page appears correct to me now, but closer examination reveals that we're simply thumbnailing both images now. At some point we increased the size of the files we were willing to thumbnail? I bet that the underlying bug is still there.