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.

git-svn-id: https://develop.svn.wordpress.org/trunk@50819 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2021-05-06 11:09:34 +00:00
parent 784a0cd87a
commit 2c9bc14b94
2 changed files with 4 additions and 16 deletions

View File

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

View File

@ -5115,18 +5115,3 @@ function wp_get_webp_info( $filename ) {
return compact( 'width', 'height', 'type' );
}
/**
* Determines if a passed image is a lossy WebP image.
*
* @since 5.8.0
*
* @param string $filename The file path.
* @return bool Whether the file is a lossy WebP file.
*/
function _wp_webp_is_lossy( $filename ) {
$webp_info = wp_get_webp_info( $filename );
$type = $webp_info['type'];
return $type && 'lossy' === $type;
}