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, azaozz.
Merges [51435] to the 5.8 branch.
Fixes #53653.
Built from https://develop.svn.wordpress.org/branches/5.8@51437


git-svn-id: http://core.svn.wordpress.org/branches/5.8@51048 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2021-07-15 13:01:58 +00:00
parent cb85548d7c
commit d06c747962
2 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

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