Skip to content

Commit

Permalink
Media: improve speed of AVIF image generation.
Browse files Browse the repository at this point in the history
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.




git-svn-id: https://develop.svn.wordpress.org/trunk@59042 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
adamsilverstein committed Sep 17, 2024
1 parent f9aeb0b commit 8f6ec89
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/wp-includes/class-wp-image-editor-imagick.php
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,11 @@ public function set_quality( $quality = null ) {
$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 );
}
Expand Down

0 comments on commit 8f6ec89

Please sign in to comment.