Media: Remove an extra variable and a redundant check in `WP_Image_Editor_Imagick::set_quality()`.

`wp_get_webp_info()` returns either a string or `false` for the `type` key, so we can just check for the string directly.

Follow-up to [50810], [50814], [50815], [50818-50820].

See #35725.
Built from https://develop.svn.wordpress.org/trunk@50821


git-svn-id: http://core.svn.wordpress.org/trunk@50430 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-05-06 15:04:57 +00:00
parent bff31c970e
commit c6028577a4
2 changed files with 2 additions and 3 deletions

View File

@ -204,9 +204,8 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
break;
case 'image/webp':
$webp_info = wp_get_webp_info( $this->file );
$type = $webp_info['type'];
if ( $type && 'lossy' === $type ) {
if ( 'lossy' === $webp_info['type'] ) {
$this->image->setImageCompressionQuality( $quality );
} else {
// Use WebP lossless settings.

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.8-alpha-50820';
$wp_version = '5.8-alpha-50821';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.