-
Notifications
You must be signed in to change notification settings - Fork 271
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
Placeholder support #189
Comments
I use vuetify image component for the lazy loading source and generate a small 10 pixel image. <v-img
:lazy-src="$img(src, { width: 10, quality: 70 })"
:src="$img(src, { quality: 70, height: 500 })"
height="500"
></v-img> |
Any ETA for this? |
also would really like to see such a feature 👍 |
same here |
please merge this cool feature :) |
@pi0 Why is the default placeholder |
Is there any way I can tell placeholder to respect |
Hi @pi0 |
Is there any way to add a placeholder globally and that's a data url like: |
By src code is not worked with srcset(browser ignore src and use srcset) and load full-size img for mobiles in parallel image/src/runtime/components/nuxt-img.ts Lines 99 to 108 in bc9ddc0
|
@mrleblanc101 |
@mrleblanc101 I have the same issue, did you fix it? |
It would be nice if the placeholder could be a base64 sent in HTML to the client rather than an additional asset to load. |
For quick history, we used to load image meta to find aspect ratio using image-meta and also fetch the contents using async data and inline base64 version in earlier versions of image v0. This feature was rolled back due to instability. Also thinking to support a pluggable way to support different algorithms for blurry image other than lowres base64. If someone is interested, a PR is welcome to add back this feature via an experimental flag. |
/cc @farnabaz |
+1 for preserving aspect ratio of source images. Any progress on this? 🙏 |
Basic placeholder property is currently supported for
<NuxtImg>
(via #477).Usage: This will auto-generate a URL from same source and
10x10
dimensions:It is also possible to give a custom placeholder (data)URL as a string or an array
[width, height, quality]
to customize URL generation behavior.The original image will be loaded during hydration and after mounted.
Future enhancements:
data:
urlThe text was updated successfully, but these errors were encountered: