zouhir / lqip-loader

Low Quality Image Placeholders (LQIP) for Webpack
1.21k stars 44 forks source link

Add an option to expose the size of the image #19

Open UwUnyaa opened 5 years ago

UwUnyaa commented 5 years ago

There are cases where people depend on the size of the image in their layout, and a tiny placeholder is obviously of smaller size, which can cause jank when images are swapped in for their full quality equivalents. With content outside of webpack, I have a way to get the size of the original image along with the placeholder and the URL to the full quality image for content outside of webpack, and I use it to set the size of the placeholder. Certain things are simply impossible without such information. My suggestion is to add an option to add width and height properties (Numbers with the value in pixels) to the Object returned from this loader. It's a minimalistic approach which makes it easy to get things like aspect ratio of the image if someone needs it, and provides information about the raw asset itself.

matsp commented 5 years ago

This would be really good. Out of the box my placeholders are actually higher than my real images which looks not so great..

I just read that the maintainer is not maintaining his OSS work at the moment :(

No joke - this would be the 5th plugin I have to fork this day :+1:

dpyzo0o commented 4 years ago

Does anyone have any solutions?