Page MenuHomePhabricator

Request image resolutions which don't require dramatic stretching to fill available area (or use aspect fit in these cases).
Closed, ResolvedPublic

Description

Example:

This pic of day is very wide:

Screen Shot 2017-05-05 at 11.43.04 PM.png (1×862 px, 274 KB)

So when it was pic of the day it looked terrible - tap the image below to see how bad it looked:

Screen Shot 2017-05-05 at 11.42.52 PM.png (1×862 px, 494 KB)

Reason:

For the sake of argument:

  • imagine this image is natively 1000 x 100 px
  • imagine the pic of day "container" area is 100 x 100 px

So if we request a scaled version of the image to perfectly fit the 100 px container width we would receive a 100 x 10 px image.

This scaled version's area is 100 x 10 = 1000.
The problem is the pic of the container is ten times that - 100 x 100 = 10,000.
This means when the scaled image then undergoes aspect fill, it will be vastly stretched (10x vertically) and look terrible - as you can see in the screenshot.

I see two ways to fix this.

  • Use the image's width to height ratio to request a scaled resolution which requires less than some maximum acceptable stretching - can be done with the container dimension and image's native resolution (which I think we get or can?).
  • Use aspect fit instead of fill when scale image area is beneath a certain percentage of the container area.

Event Timeline

Mhurd renamed this task from Request image resolutions don't require dramatic stretching to fill available area, or use aspect fit in these cases. to Request image resolutions which don't require dramatic stretching to fill available area (or use aspect fit in these cases)..May 6 2017, 6:59 AM
Mhurd updated the task description. (Show Details)
Mhurd updated the task description. (Show Details)

I thought we had a ticket for this but couldn't find it :/

LGoto lowered the priority of this task from Medium to Low.May 12 2020, 6:27 PM
ABorbaWMF subscribed.

Looks good to me on 6.8.0 (1794) using the 02/08/2021 POD which is similar to the image in the original bug description

JMinor claimed this task.