Skip to content

Commit 05d37f0

Browse files
committed
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
1 parent 8ad5281 commit 05d37f0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/wp-admin/includes/image.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,11 @@ function wp_create_image_subsizes( $file, $attachment_id ) {
301301
// The image may need to be converted regardless of its dimensions.
302302
$output_format = wp_get_image_editor_output_format( $file, $imagesize['mime'] );
303303

304-
if ( is_array( $output_format ) && array_key_exists( $imagesize['mime'], $output_format ) ) {
304+
if (
305+
is_array( $output_format ) &&
306+
array_key_exists( $imagesize['mime'], $output_format ) &&
307+
$output_format[ $imagesize['mime'] ] !== $imagesize['mime']
308+
) {
305309
$convert = true;
306310
}
307311
}

0 commit comments

Comments
 (0)