bbc / Imager.js

Responsive images while we wait for srcset to finish cooking
Apache License 2.0
3.84k stars 224 forks source link

Fixed breakpoint selection: it always opt-in for the biggest available breakpoint to fit the container size #86

Closed ChrisBAshton closed 10 years ago

ChrisBAshton commented 10 years ago

Hi,

I had a container div with no width or max width set. My maximum image size in Imager was 976px. Imager works as normal when my browser resizes anywhere beneath 976px, but the moment my viewport (and therefore the container div) is wider than 976px, Imager defaults to the smallest image (320px).

So the effect goes from 976px - fine => 977px - blurry, when the expected behaviour is to keep the largest possible image.

Hope I've explained everything sufficiently!

Integralist commented 10 years ago

@ChrisBAshton All explained perfectly. Thanks for raising this issue.

thom4parisot commented 10 years ago

The tests fails but basically it has to be related with the max screen size of the iPhone (which is smaller that 1024 in portrait mode).