strues / retinajs

JavaScript, SCSS, Sass, Less, and Stylus helpers for rendering high-resolution image variants

Home Page:http://retinajs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

define width and height of image to avoid loading unnecessary images

studio404pl opened this issue · comments

Hi,

i was thinking is there any to define somehow to your script to load 'optionally' images in high resolution?

For example i am loading some image 600px x 400px and in desktop version i need to load retina version of that image. But for example when someone is on mobile version and viewport is around 300px wide, my image has to be around 300px x 200px so technically it's already upscaled to @2x with default image (600x400), delivering in that case image with resolution 1200px x 800px makes it double double.

I am curious if there is any way to check that kind of conditions before loading images? Speed insight is really mad about delivering large images for mobile version.

Really great plugin by the way, i'd really love new version! Thanks!