-
Notifications
You must be signed in to change notification settings - Fork 39
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
Safari displays a zoomed image in degraded quality #290
Comments
Thank you for the very detailed report. I appreciate it! Apparently, you discovered a Safari bug caused by the code meant to workaround a different Safari bug 😅 yet-another-react-lightbox/src/plugins/zoom/ResponsiveImage.tsx Lines 85 to 88 in 39426d4
yet-another-react-lightbox/src/styles.scss Lines 100 to 106 in 39426d4
I'll implement another workaround to fix the blurred image, but keep in mind that images will still appear blurry during zoom-in / zoom-out transition. Screen.Recording.2024-07-01.at.7.57.10.AM.movIt's another Webkit bug dating back to 2009 😱 |
🎉 This issue has been resolved in version 3.20.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🤦 Thank you for the fix! The turnaround time is extraordinary :) The blurry part feels like expected behavior, I hope it will be fine for users. |
Describe the bug
The current desktop & mobile versions of Safari initially load smaller images from the slide's
scrSet
, and after zooming in and replacing the smaller image with the larger version, render it in degraded quality.Please check the screenshot (or the recording) with the illustration of the issue.
The browser loads the correct image (I checked this by using visually marked images), but displays it in a quality that resembles the low res version.
It seems to be caused by a bug in Safari. The
transform: translateZ(0px)
in theimg
style may change the way how the image is rendered and something in the rendering engine caches the original image dimensions. Whensrc
is replaced with another larger image it's rendered with the cached smaller dimensions.Disabling
translateZ
by adding this style resolves the problem:Expected behavior
The high res image retains its quality
How to reproduce
srcSet
with variants of different sizes.large.jpg
is displayed with degraded quality.Screenshots / Logs
Recording:
https://github.com/igordanchenko/yet-another-react-lightbox/assets/8333702/435e9aca-0f57-447e-8d85-42c83968307f
Additional context
No response
The text was updated successfully, but these errors were encountered: