mirror of
git://develop.git.wordpress.org/
synced 2025-03-23 05:20:01 +01:00
Site Health: Display a list of file formats supported by the GD library.
This adds the list of file formats supported by the GD library to the Media Handling section in Site Health. This will help site owners debug any issues they encounter as support for newer, more modern image formats is added (such as WebP in [50810]). Follow up to [50817]. Props adamsilverstein, jorbin. Fixes #53022. git-svn-id: https://develop.svn.wordpress.org/trunk@51143 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
848a678861
commit
4787fb116e
@ -631,6 +631,33 @@ class WP_Debug_Data {
|
||||
'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),
|
||||
);
|
||||
|
||||
$gd_image_formats = array();
|
||||
$gd_supported_formats = array(
|
||||
'GIF Create' => 'GIF',
|
||||
'JPEG' => 'JPEG',
|
||||
'PNG' => 'PNG',
|
||||
'WebP' => 'WebP',
|
||||
'BMP' => 'BMP',
|
||||
'AVIF' => 'AVIF',
|
||||
'HEIF' => 'HEIF',
|
||||
'TIFF' => 'TIFF',
|
||||
'XPM' => 'XPM',
|
||||
);
|
||||
|
||||
foreach ( $gd_supported_formats as $format_key => $format ) {
|
||||
$index = $format_key . ' Support';
|
||||
if ( isset( $gd[ $index ] ) && $gd[ $index ] ) {
|
||||
array_push( $gd_image_formats, $format );
|
||||
}
|
||||
}
|
||||
|
||||
if ( ! empty( $gd_image_formats ) ) {
|
||||
$info['wp-media']['fields']['gd_formats'] = array(
|
||||
'label' => __( 'GD supported file formats' ),
|
||||
'value' => implode( ', ', $gd_image_formats ),
|
||||
);
|
||||
}
|
||||
|
||||
// Get Ghostscript information, if available.
|
||||
if ( function_exists( 'exec' ) ) {
|
||||
$gs = exec( 'gs --version' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user