Make WordPress Core

Changeset 50819


Ignore:
Timestamp:
05/06/2021 11:09:34 AM (3 years ago)
Author:
SergeyBiryukov
Message:

Media: Remove _wp_webp_is_lossy() for now.

The function was only used in a single place in core.

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

Props johnjamesjacoby.
See #35725.

Location:
trunk/src/wp-includes
Files:
2 edited

Legend:

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

    r50810 r50819  
    204204                    break;
    205205                case 'image/webp':
    206                     if ( _wp_webp_is_lossy( $this->file ) ) {
     206                    $webp_info = wp_get_webp_info( $this->file );
     207                    $type      = $webp_info['type'];
     208
     209                    if ( $type && 'lossy' === $type ) {
    207210                        $this->image->setImageCompressionQuality( $quality );
    208211                    } else {
  • trunk/src/wp-includes/media.php

    r50818 r50819  
    51165116    return compact( 'width', 'height', 'type' );
    51175117}
    5118 
    5119 /**
    5120  * Determines if a passed image is a lossy WebP image.
    5121  *
    5122  * @since 5.8.0
    5123  *
    5124  * @param string $filename The file path.
    5125  * @return bool Whether the file is a lossy WebP file.
    5126  */
    5127 function _wp_webp_is_lossy( $filename ) {
    5128     $webp_info = wp_get_webp_info( $filename );
    5129     $type      = $webp_info['type'];
    5130 
    5131     return $type && 'lossy' === $type;
    5132 }
Note: See TracChangeset for help on using the changeset viewer.