From 05d37f05ad3208a2bc01e6b0cfcb7d9bcde29ee0 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Wed, 6 Nov 2024 22:33:31 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@59366 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/image.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/image.php b/src/wp-admin/includes/image.php index a764432a18..2e79578e23 100644 --- a/src/wp-admin/includes/image.php +++ b/src/wp-admin/includes/image.php @@ -301,7 +301,11 @@ function wp_create_image_subsizes( $file, $attachment_id ) { // The image may need to be converted regardless of its dimensions. $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; } }