Upgrade/Install: Indicate JPEG XL support when checking upgrades.

This adds tracking of the JPEG XL image type support alongside WebP, HEIC, and AVIF image types when requesting an upgrade from WordPress.org.

This will check for JPEG XL support in both ImageMagick and GD, even though GD technically does not yet have support for JPEG XL.

Props deepakrohilla, swissspidy, dd32, ayeshrajans, samiamnot, joemcgill.
Fixes #62050.
Built from https://develop.svn.wordpress.org/trunk@59140


git-svn-id: http://core.svn.wordpress.org/trunk@58536 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2024-09-30 22:33:15 +00:00
parent 0768f8071b
commit e86563760f
2 changed files with 5 additions and 3 deletions

View File

@ -115,26 +115,28 @@ function wp_version_check( $extra_stats = array(), $force_check = false ) {
// Filter to supported values. // Filter to supported values.
$gd_info = array_filter( $gd_info ); $gd_info = array_filter( $gd_info );
// Add data for GD WebP, AVIF and HEIC support. // Add data for GD WebP, AVIF, HEIC and JPEG XL support.
$query['image_support']['gd'] = array_keys( $query['image_support']['gd'] = array_keys(
array_filter( array_filter(
array( array(
'webp' => isset( $gd_info['WebP Support'] ), 'webp' => isset( $gd_info['WebP Support'] ),
'avif' => isset( $gd_info['AVIF Support'] ), 'avif' => isset( $gd_info['AVIF Support'] ),
'heic' => isset( $gd_info['HEIC Support'] ), 'heic' => isset( $gd_info['HEIC Support'] ),
'jxl' => isset( $gd_info['JXL Support'] ),
) )
) )
); );
} }
if ( class_exists( 'Imagick' ) ) { if ( class_exists( 'Imagick' ) ) {
// Add data for Imagick WebP, AVIF and HEIC support. // Add data for Imagick WebP, AVIF, HEIC and JPEG XL support.
$query['image_support']['imagick'] = array_keys( $query['image_support']['imagick'] = array_keys(
array_filter( array_filter(
array( array(
'webp' => ! empty( Imagick::queryFormats( 'WEBP' ) ), 'webp' => ! empty( Imagick::queryFormats( 'WEBP' ) ),
'avif' => ! empty( Imagick::queryFormats( 'AVIF' ) ), 'avif' => ! empty( Imagick::queryFormats( 'AVIF' ) ),
'heic' => ! empty( Imagick::queryFormats( 'HEIC' ) ), 'heic' => ! empty( Imagick::queryFormats( 'HEIC' ) ),
'jxl' => ! empty( Imagick::queryFormats( 'JXL' ) ),
) )
) )
); );

View File

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