Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
UwUnyaa opened this issue Jan 25, 2019 · 2 comments
Open

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

UwUnyaa opened this issue Jan 25, 2019 · 2 comments

Comments

@UwUnyaa
Copy link

UwUnyaa commented Jan 25, 2019

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
Copy link

matsp commented Feb 19, 2019

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 👍

@dpyzo0o
Copy link

dpyzo0o commented Oct 16, 2020

Does anyone have any solutions?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants