-
Notifications
You must be signed in to change notification settings - Fork 91
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 stays blurred with lqip-loader #138
Comments
+1 |
Yes so when you use the lqip loader it will return a string that is just the base64 lqip image. You need to add the image later. Example from a react component I made. async function getImage(): Promise<void> {
return new Promise((resolve, reject) => {
try {
if (imgRef.current) {
imgRef.current.onload = (): void => {
imgRef.current?.classList.add(imageStyle.sharpen)
resolve()
}
imgRef.current.src = src
imgRef.current.onanimationend = (): void =>
imgRef.current?.classList.remove(
imageStyle.blur,
imageStyle.sharpen
)
} else {
console.warn('imgRef does not have a current reference!')
}
} catch (error) {
console.error(error)
reject(error)
}
})
} |
Can you please give more context? I also have an issue with this. Can you give an example of the usage of the component you shared? |
Hi there,
I just have an issue with using lqip-loader with this package. I have:
When I check to see the result the image is blurred, but it seems to remain that way. I have tried Chrome and FF, but they both give the same still blurred image. I have tried w/ other packages such as 'webp' and they work with next-optimised-images perfectly.
Any help would be greatly appreciated as I have been fiddling around with it for a few hours with no luck.
Thanks.
Blurred still image that does not optimise:
The text was updated successfully, but these errors were encountered: