Media: Only mark an image as requiring conversion if the output format differs from the input format.

Follow up to [59317] and [59346].

Props adamsilverstein, peterwilsoncc.
See #62305.

Built from https://develop.svn.wordpress.org/trunk@59366


git-svn-id: http://core.svn.wordpress.org/trunk@58752 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Felix Arntz 2024-11-06 22:35:18 +00:00
parent ba9fe05e26
commit 9da71e3d7a
2 changed files with 6 additions and 2 deletions

View File

@ -301,7 +301,11 @@ function wp_create_image_subsizes( $file, $attachment_id ) {
// The image may need to be converted regardless of its dimensions. // The image may need to be converted regardless of its dimensions.
$output_format = wp_get_image_editor_output_format( $file, $imagesize['mime'] ); $output_format = wp_get_image_editor_output_format( $file, $imagesize['mime'] );
if ( is_array( $output_format ) && array_key_exists( $imagesize['mime'], $output_format ) ) { if (
is_array( $output_format ) &&
array_key_exists( $imagesize['mime'], $output_format ) &&
$output_format[ $imagesize['mime'] ] !== $imagesize['mime']
) {
$convert = true; $convert = true;
} }
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.8-alpha-59364'; $wp_version = '6.8-alpha-59366';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.