Make WordPress Core

Changeset 50821


Ignore:
Timestamp:
05/06/2021 03:03:32 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

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

    r50819 r50821  
    205205                case 'image/webp':
    206206                    $webp_info = wp_get_webp_info( $this->file );
    207                     $type      = $webp_info['type'];
    208 
    209                     if ( $type && 'lossy' === $type ) {
     207
     208                    if ( 'lossy' === $webp_info['type'] ) {
    210209                        $this->image->setImageCompressionQuality( $quality );
    211210                    } else {
Note: See TracChangeset for help on using the changeset viewer.