Media: improve GD support detection for AVIF.

Fix an issue where the GD image library falsely reports supporting the AVIF format, when support is actually missing. Add an additional function check to ensure AVIF support is really available.
Props niktat, adamsilverstein.
Fixes #60910


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


git-svn-id: http://core.svn.wordpress.org/trunk@57762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Adam Silverstein 2024-06-03 20:27:12 +00:00
parent 2107b186fe
commit 5e65c40921
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
case 'image/webp':
return ( $image_types & IMG_WEBP ) !== 0;
case 'image/avif':
return ( $image_types & IMG_AVIF ) !== 0;
return ( $image_types & IMG_AVIF ) !== 0 && function_exists( 'imageavif' );
}
return false;

View File

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