Make WordPress Core

Changeset 59366


Ignore:
Timestamp:
11/06/2024 10:33:31 PM (5 weeks ago)
Author:
flixos90
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/image.php

    r59317 r59366  
    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            }
Note: See TracChangeset for help on using the changeset viewer.