From b0a552657eda693d0dd7cfd9bd2fc7ae792b0979 Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Fri, 7 Oct 2022 19:17:12 +0000 Subject: [PATCH] Media: ensure the `wp_editor_set_quality` filter consistently passes the correct output mime type. Ensure that the mime type passed to the `wp_editor_set_quality` filter is correct when the output format is altered with the `image_editor_output_format` filter and the image is saved multiple times, for example when generating sub sizes. Previously, the original image mime type was passed instead of the output type after the initial save. Props flixos90, peterwilsoncc. Fixes #56442. Built from https://develop.svn.wordpress.org/trunk@54417 git-svn-id: http://core.svn.wordpress.org/trunk@53976 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-image-editor.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index e7070b1ca6..fed0fc16e8 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -414,8 +414,8 @@ abstract class WP_Image_Editor { // The image will be converted when saving. Set the quality for the new mime-type if not already set. if ( $mime_type !== $this->output_mime_type ) { $this->output_mime_type = $mime_type; - $this->set_quality(); } + $this->set_quality(); } elseif ( ! empty( $this->output_mime_type ) ) { // Reset output_mime_type and quality. $this->output_mime_type = null; diff --git a/wp-includes/version.php b/wp-includes/version.php index f141d0cd3a..2f71d17499 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta3-54416'; +$wp_version = '6.1-beta3-54417'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.