juliomrqz / nuxt-optimized-images

🌅🚀 Automatically optimizes images used in Nuxt.js projects (JPEG, PNG, SVG, WebP and GIF).
https://marquez.co/docs/nuxt-optimized-images/
MIT License
842 stars 30 forks source link

Adding image size query param #347

Open sylvinus opened 2 years ago

sylvinus commented 2 years ago

Hello!

Looking at this module to optimize web performance, and with this in mind: https://www.smashingmagazine.com/2020/03/setting-height-width-images-important-again/

I'd like to propose adding a ?size query parameter that would return the intrinsic image width and height, much like ?lqip-colors works today. This would allow us to hint the aspect ratio to browsers in a custom component before the image is loaded to avoid layout shifts.

Thanks!