Comment 7 for bug 1467740

Revision history for this message
Albert Astals Cid (aacid) wrote :

> I don't quite understand why you need to know the aspect ratio beforehand.
> Surely, there must be some display size into which the thumbnail is expected to fit?

Ok, let's give you an example.

I know i have to fit my image in something that is 100 width x 100 height and i am using the PreserveAspectCrop fill format meaning the image is scaled uniformly to fill, cropping if necessary

If i don't know the aspect ratio of the image that i have to draw which size do i request?

If the image is portrait i have to request (100, 0)

If the image is landscape i have to request (0, 100)

See http://paste.ubuntu.com/12197917/ using http://i.imgur.com/xiP0k4T.jpg as landscape.jpg and http://i.imgur.com/A2M6bnF.jpg as portrait.jpg and you'll see http://i.imgur.com/f5sEMhe.png. You can see there why we need to know the aspect ratio to achive the best quality. In the first row "Source Size Width" has the best quality while in the second row "Source Size Height" has the best quality.