From 9da71e3d7ace6978b348d809923a18cab941e527 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Wed, 6 Nov 2024 22:35:18 +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. Built from https://develop.svn.wordpress.org/trunk@59366 git-svn-id: http://core.svn.wordpress.org/trunk@58752 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/image.php | 6 +++++- wp-includes/version.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wp-admin/includes/image.php b/wp-admin/includes/image.php index a764432a18..2e79578e23 100644 --- a/wp-admin/includes/image.php +++ b/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; } } diff --git a/wp-includes/version.php b/wp-includes/version.php index 9a6bda7377..645b8cf381 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.