mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Media: When resizing WebP images set the compression to "lossy" by default. Fixes a bug where the compression was set to "lossless" when the uploaded WebP images have extended file format (VP8X).
Props adamsilverstein, mikeschroder, mmxxi, linux4me2. Fixes #53653. git-svn-id: https://develop.svn.wordpress.org/trunk@51435 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
256a0eea8a
commit
f17f4f5f7e
@ -205,12 +205,12 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
||||
case 'image/webp':
|
||||
$webp_info = wp_get_webp_info( $this->file );
|
||||
|
||||
if ( 'lossy' === $webp_info['type'] ) {
|
||||
$this->image->setImageCompressionQuality( $quality );
|
||||
} else {
|
||||
if ( 'lossless' === $webp_info['type'] ) {
|
||||
// Use WebP lossless settings.
|
||||
$this->image->setImageCompressionQuality( 100 );
|
||||
$this->image->setOption( 'webp:lossless', 'true' );
|
||||
} else {
|
||||
$this->image->setImageCompressionQuality( $quality );
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user