lqip-loader icon indicating copy to clipboard operation
lqip-loader copied to clipboard

Add an option to expose the size of the image

Open UwUnyaa opened this issue 6 years ago • 2 comments

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.

UwUnyaa avatar Jan 25 '19 18:01 UwUnyaa

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:

matsp avatar Feb 19 '19 20:02 matsp

Does anyone have any solutions?

dpyzo0o avatar Oct 16 '20 06:10 dpyzo0o