-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Magento 2.4.4 does not support .webp upload #35836
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
Hi @Toinehaaijer. Thank you for your report.
Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:
For more details, review the Magento Contributor Assistant documentation. Add a comment to assign the issue: To learn more about issue processing workflow, refer to the Code Contributions.
🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket. ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
Hi @engcom-Lima. Thank you for working on this issue.
|
Hi @Toinehaaijer , As per M2 document only JPG & PNG file format is supported.And webp file format is not supported. Let us know if you are facing any issue with other file formats. Thanks |
@engcom-Lima Thanks, I couldn't find that part of the docs. Is it possible to turn webp compatibility into a feature request? |
@Toinehaaijer I will discuss internally for your query then, I will come back to you as soon as possible. |
Hi @Toinehaaijer We want to know your use case for using webp type format? Thanks |
Hi @engcom-Lima, our use case would be increasing performance/load times, as webp should be about 25%-34% smaller than a jpeg, and 26% smaller than a png. Also, it would increase flexibility for end users who don't really give file/mime types a second thought. WEBP compatibility seems really good now, only IE (and KaiOS browser) don't support this: https://caniuse.com/webp |
Hi @Toinehaaijer , Thanks for your contribution and collaboration. Thanks |
@Toinehaaijer You should use Yireo plugin for webp support: https://www.yireo.com/software/magento-extensions/webp2 |
@ananth-iyer Thanks, I've already looked at this plugin and it does add webp compatibility, but in a different way. It generates webp images based on jpg and png images you've added to the site. The problems I have with this plugin:
|
We should add support for avif too, even if avif is not supported everywhere yet. Let's anticipate. Also, |
@magento I am working on this |
It is 2023, we should have webp native support in magento already. https://caniuse.com/webp |
I would vote not adding those format for now and leave them to 3rd party modules. They don't seem to be that commonly used |
The other huge reason is the filesize. I have a project that has just about 210K products, with a total size of images: 256Gb. So apart from talking about web performance, we should also talk about storage performance. I am in the process of importing the catalog, but I have a huge problem with available disk space. On my local dev server it's not an issue, but on a staging server or even production, disk space is quite a premium. I have PNG and JPG images 800 x 800 with filesizes 1.1mb. Converting to webp with quality 80, reduces the filesize to 76k without losing the resolution. So this begs the question, why would I not favor uploading webp natively, smaller images (filesize-wise), instead of huge png or jpg images? I am in the process of batch converting all the images to webp to see the outcome. I am also doing the same experiment with png/jpg files, but reducing the resolution of all images > 300 in width to 300 max width, while maintaining aspect ratio. The latter expeiment is not ideal, because I would prefer a reduction in filesize while maintaining high resolution, i.e. webp. Let's keep in mid that images are by default uploaded to pub/media/catalog, in the same directory as the Magento instance resides. Magmi does the same thing. Therefore, using 3rd party modules is of no immediate benefit, because they convert to webp on the fly already uploaded png/jpg files. The situation gets more complicated if you wish to use S3 or [Cloudflare] R2, 256Gb worth of images is quite expensive and not all merchants can afford the costs for large cloud based storage. The right solution would be to allow webp uploading natively in Magento, and support it natively. My 2c worth. I am using Magento 2.4.6-p2 CE. |
Hello!, I'm having problems adding webp images, and I was looking for solutions until I found this post, any news? I have tried to hardcode the code since as I have seen, compatibility by php in the magento code is included, but in the core of it it seems that it only supports jpg and png, adding webp does not work, as expected, like this I'm here to see who can think of something. EDIT: Im find this extension: https://github.com/MagestyApps/module-web-images It works for me, it allows me to upload webp images and import products with .webp images. |
@antoniocastillomartinez sadly but it does not work for me. In admin I still see message |
Now we have 2025 are you planning to support webp format? I am interested in that too... |
no they won't cause they sell modules for that ;) no webp upload from backend and no api uploads... shame |
Preconditions and environment
We currently have our own API set up to connect to Magento, and we provide content from this; including images. This includes various mime types, including webp.
Whenever we try to send that image through the Magento REST API, it says it does not support the mime type.
We have also tried uploading an image in the magento admin page for:
Steps to reproduce
Below the steps to reproduce the issue with the REST API:
Expected result
Image is added to the gallery of the specified product.
Actual result
Error 400 Bad Request:
{"message":"The image MIME type is not valid or not supported."}
.On API Call: |POST| http://my.magento.com/rest/all/V1/products/{id}/media
Additional information
Magento\Framework\Api\ImageContentValidator
has the following allowed mime types:
There are other classes that have this same list of $defaultMimeTypes and $allowedMimeTypes.
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: