Skip to content
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

Fix wp_editor_set_quality to support setting quality for both loaded and saved image types #1622

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

azaozz
Copy link
Contributor

@azaozz azaozz commented Aug 26, 2021

Introduce $output_mime_type in WP_Image_Editor and set it on saving the image if different from the original image's mime-type. Add tests.

Trac ticket: https://core.trac.wordpress.org/ticket/53667


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@azaozz
Copy link
Contributor Author

azaozz commented Aug 26, 2021

Also introduces WP_Image_Editor::get_default_quality( $mime_type ) to be able to have different default quality for different image formats.

Currently the quality is (re)set and the wp_editor_set_quality filter runs only once when the output image type is different from the input image type. Can be changed to run every time on saving an image, for example when creating image sub-sizes.

@draganescu
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants