Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Select image editor based on WebP support instead of always using the default one #259

Merged
merged 3 commits into from
Mar 24, 2022

Conversation

mitogh
Copy link
Member

@mitogh mitogh commented Mar 24, 2022

Summary

Fixes #258

Relevant technical choices

The update uses WP internals to allow for a more appropriate editor instead of the default one based only on the image file when the provided mime type would make a difference as the provided mime type might be supported for other editors besides the default one.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

mitogh added 3 commits March 23, 2022 22:29
By doing so we are able to perform all the logic
when replacing an editor and using an image editor with
support for all the functionality allowing us to override
the default methods as need it.
Due this logic is already handled by the image editor
there's no need for us to mock this logic if not required.
If no editor or mime is supported there's no need to go
down the logic of the function creating an image if no
editor is available or if the mime is not supported.
@mitogh mitogh added [Type] Bug An existing feature is broken [Focus] Images labels Mar 24, 2022
@mitogh mitogh added this to the 1.0.0-beta.4 milestone Mar 24, 2022
@mitogh mitogh self-assigned this Mar 24, 2022
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mitogh Awesome work catching and fixing this!

@felixarntz felixarntz changed the title Select the best editor available instead of the default one. Select image editor based on WebP support instead of always using the default one Mar 24, 2022
@mitogh mitogh merged commit 6a9a994 into trunk Mar 24, 2022
@mitogh mitogh deleted the bug/258-default-image-editor branch March 24, 2022 18:50
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
[Type] Bug An existing feature is broken
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WebP are not created when the default editor does not support WebP
3 participants