Skip to content

Conversation

@SharkyKZ
Copy link
Contributor

Summary of Changes

Adds WebP support to image library.

Testing Instructions

Upload a webp image to template directory.
Go to com_templates.
In configuration add webp to Valid Image Formats field.
Go to template files and try to edit the image.

Actual result BEFORE applying this Pull Request

Error:

Attempting to load an image of unsupported type image/webp

Expected result AFTER applying this Pull Request

Image can be opened and edited (but is saved in wrong format).

Documentation Changes Required

IDK.

@richard67
Copy link
Member

Expected result AFTER applying this Pull Request

Image can be opened and edited (but is saved in wrong format).

@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?

@SharkyKZ
Copy link
Contributor Author

This is fixed in staging with #30977. Once it reaches 4.0-dev, we'll just need to add a case for WebP.

@richard67
Copy link
Member

@SharkyKZ I see. With "format" you meant the size, not the image type, right?

@SharkyKZ
Copy link
Contributor Author

No. All images are saved as JPEGs.

@richard67
Copy link
Member

Ah, ok.

@richard67
Copy link
Member

At least JPEG and not BMP ;-)

@richard67
Copy link
Member

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.

@dgrammatiko
Copy link
Contributor

@SharkyKZ can you check if GD supports AVIF files and if so enable them as well?
Info: https://jakearchibald.com/2020/avif-has-landed/

@SharkyKZ
Copy link
Contributor Author

I don't think it does.

@jwaisner
Copy link
Member

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.

@jwaisner
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/31048.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Oct 12, 2020
Co-authored-by: Quy <[email protected]>
Co-authored-by: Quy <[email protected]>
@richard67
Copy link
Member

Previous tests are still valid since changes after those were only in code style (indent) and comment.

@jiweigert
Copy link

For the question if GD support AVIF format.

As the underlying libgd don't support it, GD does not either.
There is an open issue at: libgd/libgd#557

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.

@Quy
Copy link
Contributor

Quy commented Oct 12, 2020

Should the installation sql/xml files be updated to include webp for Valid Image Formats?

@N6REJ
Copy link
Contributor

N6REJ commented Oct 12, 2020

how about adding webm @ the same time?

@SharkyKZ
Copy link
Contributor Author

@Quy Not going to do this here. You can make a separate PR. Otherwise I'll wait for #30977 to be merged into 4.0 first.

@N6REJ WebM is not an image format.

@rdeutz rdeutz merged commit f5c3531 into joomla:4.0-dev Oct 16, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Oct 16, 2020
@rdeutz rdeutz added this to the Joomla 4.0 milestone Oct 16, 2020
@piotr-cz
Copy link
Contributor

piotr-cz commented Nov 4, 2020

What are your opinions about backporting this into the 3.x branch?

@morsssss
Copy link

Hey, I'm excited to see this interest in AVIF from Joomla!

I'm working on implementing libgd/libgd#557 right now...

@brianteeman
Copy link
Contributor

@morsssss Thanks for popping in Ben. We have another open issue about AVIF (see #30666) it would be great if you could keep us updated with your progress over there.

@morsssss
Copy link

Thanks for letting me know! I can do that.

@morsssss
Copy link

Just letting you know that this PR is almost out of review. I expect it to be merged soon!

brianteeman added a commit to brianteeman/joomla-cms that referenced this pull request Apr 10, 2021
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
brianteeman added a commit to brianteeman/joomla-cms that referenced this pull request Apr 10, 2021
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
brianteeman added a commit to brianteeman/joomla-cms that referenced this pull request May 2, 2021
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
@ChristineWk ChristineWk mentioned this pull request Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.