diff --git a/wp-includes/class-wp-image-editor-imagick.php b/wp-includes/class-wp-image-editor-imagick.php index b35e02a873..ae91e46970 100644 --- a/wp-includes/class-wp-image-editor-imagick.php +++ b/wp-includes/class-wp-image-editor-imagick.php @@ -205,12 +205,12 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor { case 'image/webp': $webp_info = wp_get_webp_info( $this->file ); - if ( 'lossy' === $webp_info['type'] ) { - $this->image->setImageCompressionQuality( $quality ); - } else { + if ( 'lossless' === $webp_info['type'] ) { // Use WebP lossless settings. $this->image->setImageCompressionQuality( 100 ); $this->image->setOption( 'webp:lossless', 'true' ); + } else { + $this->image->setImageCompressionQuality( $quality ); } break; default: diff --git a/wp-includes/version.php b/wp-includes/version.php index edc30ac602..a8f08481f2 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51434'; +$wp_version = '5.9-alpha-51435'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.