-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.0] Add WebP support to Image library #31048
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
Conversation
@SharkyKZ Is there something we can do to solve the "is saved in wrong format"? If so, you want to do it with this PR, or want to make a new one, or not want to do it at all? |
|
This is fixed in staging with #30977. Once it reaches 4.0-dev, we'll just need to add a case for WebP. |
|
@SharkyKZ I see. With "format" you meant the size, not the image type, right? |
|
No. All images are saved as JPEGs. |
|
Ah, ok. |
|
At least JPEG and not BMP ;-) |
|
I have tested this item ✅ successfully on 0fabc63 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31048. |
|
@SharkyKZ can you check if GD supports AVIF files and if so enable them as well? |
|
I don't think it does. |
|
I have tested this item ✅ successfully on 0fabc63 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31048. |
|
RTC This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31048. |
Co-authored-by: Quy <[email protected]>
Co-authored-by: Quy <[email protected]>
|
Previous tests are still valid since changes after those were only in code style (indent) and comment. |
|
For the question if GD support AVIF format. As the underlying libgd don't support it, GD does not either. Basically, they wait for a plugin that that they can link to and do the work.. or someone who implement avif support. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31048. |
|
Should the installation sql/xml files be updated to include |
|
how about adding webm @ the same time? |
|
What are your opinions about backporting this into the 3.x branch? |
|
Hey, I'm excited to see this interest in AVIF from Joomla! I'm working on implementing libgd/libgd#557 right now... |
|
Thanks for letting me know! I can do that. |
|
Just letting you know that this PR is almost out of review. I expect it to be merged soon! |
joomla#31048 provided the library level support for webp images This PR adds webp to the list of allowed image types for com_templates. It does not have an update sql as that would change user data. This isnt really anything to test here accept codestyle as using webp images in templates was the test for the libray update so we know it works
joomla#31048 added support for webp images however it was not complete. MediaHelper::isImage was not updated to support webp. As a result while webp could be added to media manager as an allowed image format everything worked except for the display of the thumbnail. As this PR fixes that we might as well add webp to the default list of supported image formats. To test 1. either do a fresh install with the prebuilt package OR apply this pr, run npm ci and go to the media manager options. delete all the values in the Legal Extensions (File Types), Legal Image Extensions (File Types) and Legal MIME Types and then save the options. This will reset the value to the new defaults. 2. Try to upload any webp image 3. Try to crop and resize the image 4. Try to rename the image 5. Get a shareable link and make sure it works
joomla#31048 added support for webp images however it was not complete. MediaHelper::isImage was not updated to support webp. As a result while webp could be added to media manager as an allowed image format everything worked except for the display of the thumbnail. As this PR fixes that we might as well add webp to the default list of supported image formats. To test 1. either do a fresh install with the prebuilt package OR apply this pr, run npm ci and go to the media manager options. delete all the values in the Legal Extensions (File Types), Legal Image Extensions (File Types) and Legal MIME Types and then save the options. This will reset the value to the new defaults. 2. Try to upload any webp image 3. Try to crop and resize the image 4. Try to rename the image 5. Get a shareable link and make sure it works
Summary of Changes
Adds WebP support to image library.
Testing Instructions
Upload a
webpimage to template directory.Go to
com_templates.In configuration add
webptoValid Image Formatsfield.Go to template files and try to edit the image.
Actual result BEFORE applying this Pull Request
Error:
Expected result AFTER applying this Pull Request
Image can be opened and edited (but is saved in wrong format).
Documentation Changes Required
IDK.