From 5e65c40921d0fe94442932bb666bf303baba570c Mon Sep 17 00:00:00 2001 From: Adam Silverstein Date: Mon, 3 Jun 2024 20:27:12 +0000 Subject: [PATCH] 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 --- wp-includes/class-wp-image-editor-gd.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-wp-image-editor-gd.php b/wp-includes/class-wp-image-editor-gd.php index 5aa85b0eb5..acb3dd5026 100644 --- a/wp-includes/class-wp-image-editor-gd.php +++ b/wp-includes/class-wp-image-editor-gd.php @@ -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; diff --git a/wp-includes/version.php b/wp-includes/version.php index 8a23c25205..1d98d7613e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.