mirror of
git://develop.git.wordpress.org/
synced 2025-03-12 07:59:45 +01:00
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:
parent
784a0cd87a
commit
2c9bc14b94
@ -203,7 +203,10 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||||||
$this->image->setImageCompression( imagick::COMPRESSION_JPEG );
|
$this->image->setImageCompression( imagick::COMPRESSION_JPEG );
|
||||||
break;
|
break;
|
||||||
case 'image/webp':
|
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 );
|
$this->image->setImageCompressionQuality( $quality );
|
||||||
} else {
|
} else {
|
||||||
// Use WebP lossless settings.
|
// Use WebP lossless settings.
|
||||||
|
@ -5115,18 +5115,3 @@ function wp_get_webp_info( $filename ) {
|
|||||||
|
|
||||||
return compact( 'width', 'height', 'type' );
|
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;
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user