Created
July 8, 2022 19:41
-
-
Save adamsilverstein/b0836b1a064b82f62351c8935f9a8be6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/wp-includes/class-wp-image-editor.php b/src/wp-includes/class-wp-image-editor.php | |
index 6b63d7e9fd..e17b787223 100644 | |
--- a/src/wp-includes/class-wp-image-editor.php | |
+++ b/src/wp-includes/class-wp-image-editor.php | |
@@ -414,12 +414,10 @@ abstract class WP_Image_Editor { | |
$filename = trailingslashit( $dir ) . wp_basename( $filename, ".$ext" ) . ".{$new_ext}"; | |
} | |
- if ( $mime_type && ( $mime_type !== $this->mime_type ) ) { | |
- // The image will be converted when saving. Set the quality for the new mime-type if not already set. | |
- if ( $mime_type !== $this->output_mime_type ) { | |
- $this->output_mime_type = $mime_type; | |
- $this->set_quality(); | |
- } | |
+ if ( $mime_type && ( $mime_type !== $this->output_mime_type ) ) { | |
+ // The image will be converted when saving. Set the quality for the new mime-type. | |
+ $this->output_mime_type = $mime_type; | |
+ $this->set_quality(); | |
} elseif ( ! empty( $this->output_mime_type ) ) { | |
// Reset output_mime_type and quality. | |
$this->output_mime_type = null; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment