-
Notifications
You must be signed in to change notification settings - Fork 27.2k
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
Image blur placeholder not taking full width with fill image #42765
Comments
If the Although its worth trying it out and seeing if it works without causing artifacts like #40419
SVG blur performs better compared to CSS blur. It also means we don't need JS to remove any CSS once the image loads.
Thanks I was able to reproduce! This is entering the deopt mode here where the width/height of the blurDataURL are not known so it falls back to CSS blur.
Another thing we could try is adding new props for |
Adding |
Thanks, I created #44317 with a fix! Its difficult to test all the cases here without manually looking at the result so I'll need to make sure it doesn't break anything else. |
We upgraded to the new Next.js image and encountered the same problem. I'm not sure if this helps but using aspect ratio in the wrapper element solves the issue. Unfortunately, it cannot be used for our application. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Verify canary release
Provide environment information
What browser are you using? (if relevant)
Chrome 107.0.5304.87
How are you deploying your application? (if relevant)
No response
Describe the Bug
When using the
Image
component (Next.js v13) withfill
and ablurDataURL
, the blurred placeholder is not taking the full width of the viewport as the loaded image does.I stumbled across this PR which fixed some bugs related to the blur placeholder. It seems that adding
preserveAspectRatio="none"
to the generated SVG without width / height would fix the issue but I don't know the implications.Also, why is it an SVG and not just the
base64
image as it was on Next.js v12?Expected Behavior
The blurred SVG should take the full width of the viewport and not display empty spaces around the image. It was working correctly on Next.js v12.
Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster
https://codesandbox.io/s/goofy-orla-v8kciw
To Reproduce
Use an
Image
component withfill
and ablurDataURL
.The text was updated successfully, but these errors were encountered: