Make WordPress Core


Ignore:
Timestamp:
10/07/2022 07:15:59 PM (3 years ago)
Author:
adamsilverstein
Message:

Media: ensure the wp_editor_set_quality filter consistently passes the correct output mime type.

Ensure that the mime type passed to the wp_editor_set_quality filter is correct when the output format is altered with the image_editor_output_format filter and the image is saved multiple times, for example when generating sub sizes. Previously, the original image mime type was passed instead of the output type after the initial save.

Props flixos90, peterwilsoncc.
Fixes #56442.

File:
1 edited

Legend:

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

    r54265 r54417  
    415415            if ( $mime_type !== $this->output_mime_type ) {
    416416                $this->output_mime_type = $mime_type;
    417                 $this->set_quality();
    418417            }
     418            $this->set_quality();
    419419        } elseif ( ! empty( $this->output_mime_type ) ) {
    420420            // Reset output_mime_type and quality.
Note: See TracChangeset for help on using the changeset viewer.