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.
Built from https://develop.svn.wordpress.org/trunk@50819


git-svn-id: http://core.svn.wordpress.org/trunk@50428 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2021-05-06 11:10:57 +00:00
parent 8b18915601
commit 7b2335eb40
3 changed files with 5 additions and 17 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;
}

View File

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