Only use preset resolutions for image calculations#139
Only use preset resolutions for image calculations#139zorker wants to merge 1 commit intoMattWilcox:masterfrom zorker:patch-1
Conversation
Script is changed to pick a resolution that best matches the resolutions found in the resolution array. Thus fewer images need to be generated. DPI is factored in. If your max resolution is 480 and your DPI is 2 and you have a value in the array of 1024 it will pick 1024 because it is the closest value that is still >= "test". Additionally changed the cache folder to use /$resolution/hash as the cache file.
|
Thanks for this! It works great :) |
|
@zorker I'm experiencing an issue with Retina iPads: Holding it in portrait mode (768px width) i'm displaying a picture in 752px width, now with dpi=2 it should deliver a picture with 1504px but it doesnt. My highest breakpoint is 1200, according to the css. Should i therefore define another breakpoint that is higher? I already have image folders with 1800 and 2400 so i think i should add them to the breakpoint list, right? |
|
@discotizer Btw...you can debug this in Chrome aswell because when zooming in Chrome (CTRL+scrollwheel) Chrome will keep window size and change the DPI. Firefox does the same but sadly it shrinks/increases the window size aswell so the endresult is the same image size. |
Script is changed to pick a resolution that best matches the resolutions found in the resolution array. Thus fewer images need to be generated. DPI is factored in. If your max resolution is 480 and your DPI is 2 and you have a value in the array of 1024 it will pick 1024 because it is the closest value that is still >= "test".
Additionally changed the cache folder to use /$resolution/hash as the cache file.