You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The rewritten img tag should ignore the dimensions in the tag, which also has the side benefit of allowing images with a % based width to be optimized.
Instead it should just add a scrset which points to all the optimized sizes. In conjunction with #7 is should detect when an image needs to be resized based on dimensions and then queue up the asynchronous production of a set of better sizes, which could possibly be set in site config.
A good guide might be to resize anything over 200x200 pixels, and produce a set of sizes up to the largest reasonable desktop or retina size.
ie if an image comes in which is 2000x1800 you could say 'give me the largest image which fits in 1000x1000 as the first size, and then 640x640 and 320x320 which would produce these 3 sizes for the srcset:
1000 x 900
640 x 576
320 x 288
Or alternatively a better algorithm might instead of using x and y limits, use a pixel count limit for each size, eg the largest size should be no more than 1 megapixel, medium no more than .5 megapixels and small .2 megapixels.
The text was updated successfully, but these errors were encountered:
Hi Branden, thanks for raising this issue and #7. I'm wiped out after watching Star Wars until 3:30am so I'll have to look at this next week. Sounds like you have some great ideas for making the filter better (and more secure) and I'll look at them in detail as soon as I can. Feel free to file a pull request if you get time.
The rewritten img tag should ignore the dimensions in the tag, which also has the side benefit of allowing images with a % based width to be optimized.
Instead it should just add a scrset which points to all the optimized sizes. In conjunction with #7 is should detect when an image needs to be resized based on dimensions and then queue up the asynchronous production of a set of better sizes, which could possibly be set in site config.
A good guide might be to resize anything over 200x200 pixels, and produce a set of sizes up to the largest reasonable desktop or retina size.
ie if an image comes in which is 2000x1800 you could say 'give me the largest image which fits in 1000x1000 as the first size, and then 640x640 and 320x320 which would produce these 3 sizes for the srcset:
Or alternatively a better algorithm might instead of using x and y limits, use a pixel count limit for each size, eg the largest size should be no more than 1 megapixel, medium no more than .5 megapixels and small .2 megapixels.
The text was updated successfully, but these errors were encountered: