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

lazysizes - Aspect ratio not working for sources when {width} and {height} placeholders used #831

Closed
roberthenniger opened this issue Oct 19, 2020 · 2 comments

Comments

@roberthenniger
Copy link

roberthenniger commented Oct 19, 2020

Aspect Ratio is not calculated for every picture source and only taken from the img itself.

https://jsfiddle.net/roberthenniger/o6qzsh9m/
https://stackoverflow.com/questions/64431104/lazysizes-aspect-ratio-not-working-for-sources-when-width-and-height-place

Would expect the lazysizes to use the aspect ratio from the source instead of image since otherwise no different aspect ratio for different screen size is possible.

What happened instead
Lazysizes uses the aspect ratio from the img tag itself.

Tested on Chrome 85. on Mac, Safari 14.0

@roberthenniger
Copy link
Author

roberthenniger commented Oct 19, 2020

Also saw that issue #490 which seems not the same topic. Was trying to use a custom function to calculate the height myself but it seems that its only triggered for the img tag itself and not four all sources of the picture.

@aFarkas
Copy link
Owner

aFarkas commented Oct 24, 2020

I have just added a fix for this. Could yoou checkout and try the newest change? Thank yo

@aFarkas aFarkas closed this as completed Dec 29, 2020
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

2 participants