Page MenuHomePhabricator

Can't create thumbnail of images with a peculiar aspect ratio
Closed, ResolvedPublic

Description

Author: broken.arrow

Description:
Thumbnailing very tall and narrow images, whose width is only a few pixels (like the one above, 2 × 295 pixels) does not work in galleries. According to Brion, the code may be trying to scale to less than 1 pixel wide. Example:
http://commons.wikimedia.org/w/index.php?title=Special:NewImages&until=20080324144749


Version: 1.13.x
Severity: minor
URL: http://commons.wikimedia.org/wiki/Image:VBAR.png

Details

Reference
bz13493

Event Timeline

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

The base problem is that MediaWiki tracks thumbnails by width, and here we're requesting a size that's not going to fit in the 120x120 box... The 1px-wide image will be ~148 pixels tall, so it has to back down a pixel to 0px... which is invalid.

(Note that the equivalent horizontal bar renders to a 120x120 box just fine, since we can request the exact desired width.)

Probably what we want to do here is take the 1px version, then if necessary scale it client-side to fit vertically.

Bryan.TongMinh wrote:

Client side scaling for <1px images in either direction looks like the best solution to me.

Bryan.TongMinh wrote:

This was fixed somewhere along the way.