Media: improve speed of AVIF image generation.

Set the AVIF encoder to work faster by raising heic:speed to 7 from the default of 5. AVIF generation time is reduced by up to 20% with minimal impact on image size.

Props: adamsilverstein, erikyo, mukesh27, yguyon, felixarntz, jzern.
Fixes #61758.



Built from https://develop.svn.wordpress.org/trunk@59042


git-svn-id: http://core.svn.wordpress.org/trunk@58438 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2024-09-17 23:29:29 +00:00
parent 549f626d96
commit d10887c93d
2 changed files with 6 additions and 1 deletions

View File

@ -219,6 +219,11 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
$this->image->setImageCompressionQuality( $quality );
}
break;
case 'image/avif':
// Set the AVIF encoder to work faster, with minimal impact on image size.
$this->image->setOption( 'heic:speed', 7 );
$this->image->setImageCompressionQuality( $quality );
break;
default:
$this->image->setImageCompressionQuality( $quality );
}

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.7-alpha-59041';
$wp_version = '6.7-alpha-59042';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.