Page MenuHomePhabricator

Resizing to specified height broken for very thin images
Closed, ResolvedPublic

Description

Author: Bryan.TongMinh

Description:
Resizing an image with a width much smaller than height to a specified height is broken, because it may result in a zero pixel width. A minimum width of 1 pixel for a thumbnail should be enforced.

See http://test.wikipedia.org/wiki/Bug_28076 to see the bug in action.


Version: unspecified
Severity: normal

Details

Reference
bz28762

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:30 PM
bzimport set Reference to bz28762.

Did part of the patch you had on Bug #28076 fix this? If so, could you attach that patch here?

Bryan.TongMinh wrote:

Broken patch

It should have, but it broke some other cases which I haven't fully investigated. Parser tests indicate that in some cases the height attribute of <img>s is set to -1.

Attached:

Copying comment from triage for posterity:

patch needs to be checked to see if it changes any 'real' image sizes and to
confirm that it correctly ensures minimum single pixels without becoming
inconsistent (since we refer to thumbs by their width, we can't have a 1px-wide
image that's 50px high and another that's 500px high.)

Bryan.TongMinh wrote:

Yes, that would break. We'll have to output the 1px image then and defer to client side scaling for the further downscaling.

Bryan.TongMinh wrote:

Related bug 24763

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:27 AM
Gilles added a project: Multimedia.
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:20 AM