-
Notifications
You must be signed in to change notification settings - Fork 86
Add support for WebP images using next/image
optimization
#133
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
Comments
See closed (false) bug for further context. |
this is a great idea. swapping out the image processing library is definitely possible we'll put this on the list, but if someone wanted to PR a change in the meantime, we'd very much welcome that! |
This one is a big deal. Part of why I use NextJS image optimization is because it provides automatic WebP support. One option could be to include webp-converter and check the Accept header of the request. |
hello! per some netlify announcements today (see: #155 (comment)), we've put out a special release of the plugin with some next/image and ISR related changes. while swapping per that comment i shared above, what i can offer you today is the special release:
as mentioned in that comment, it's my hope we can get this in a main release after some testing. please let me know if you have any questions for feedback!!! |
note: the sharp change means that any plugin users using next/image can no longer use the CLI to build and deploy their sites. this is because sharp's native binaries need to be compiled on the same platform they'll be deployed (aka linux aka the AWS runtime OS). using the CI and site build system will work fine. this is something we're looking into internally. |
Does the current implementation optimize images? I have a it doesn't convert to webp as mentioned in this issue. But it also does not optimize/compress the quality for the web. Is this expected? |
@surjithctly hey! our logic is not built to convert png (or any other image type) to webp. we maintain the image type from what we receive. it should optimize if you pass a quality property to your image component. |
Fixed via #330 - there's now an env var to force images to webp! (check out the image handling section of the README) |
Is your feature request related to a problem? Please describe.
WebP is super great. The underlying
jimp
package doesn't support it.Describe the solution you'd like
Add some method of supporting WebP in the next.js image optimization flow.
Describe alternatives you've considered
Not using
next/image
is not ideal as it's such a powerful feature of next-gen Next.jsAdditional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: