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

Zoomed image size exceed intrinsic image size #200

Open
bdauton opened this issue Apr 12, 2023 · 3 comments
Open

Zoomed image size exceed intrinsic image size #200

bdauton opened this issue Apr 12, 2023 · 3 comments

Comments

@bdauton
Copy link

bdauton commented Apr 12, 2023

Hi,

I'd like to know if it's possible that the zoomed image size do not exceed the real image size so the zoomed image is not blurry when the the viewport is huge.

I use the data-zoom-src attribute to provide the HD image url and also widthand height attributes set to the low definition image sizes to prevent document layout shifts.

Thanks,
Ben

@francoischalifour
Copy link
Owner

Can you please reproduce the wrong behavior you're experiencing in this sandbox? Thanks!

@bdauton
Copy link
Author

bdauton commented Apr 12, 2023

Ok, It's me, I used the wrong images… Can you just confirm I handle well the thumbnails/zoomed/2x things? I try to reduce the overall page weight…

<img src="low-def-thumbnail.jpg" srcset="[email protected] 2x" data-zoom-src="[email protected]" width="{low-def-thumbnail-width}" height="{low-def-thumbnail-height}" loading="lazy"> ?

Thanks!

@bdauton
Copy link
Author

bdauton commented Apr 18, 2023

Ok, I updated the sandbox with to examples: one with loading="lazy" and one without.

It seems to work as expected in both cases only with Chrome. With Firefox, the zoomed image doesn't respect the intrinsic image size. Using Safari, without loading="lazy", it works well but as soon as the attribute is added, the zoomed image is still the thumbnail.

Am I missing something?

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