Make WordPress Core

Ticket #53022: 53022.4.diff

File 53022.4.diff, 1.3 KB (added by adamsilverstein, 4 years ago)
  • src/wp-admin/includes/class-wp-debug-data.php

    diff --git src/wp-admin/includes/class-wp-debug-data.php src/wp-admin/includes/class-wp-debug-data.php
    index 85ef2384c9..80fece6cfc 100644
    class WP_Debug_Data { 
    631631                        'debug' => ( is_array( $gd ) ? $gd['GD Version'] : 'not available' ),
    632632                );
    633633
     634                $gd_image_formats     = array();
     635                $gd_supported_formats = array(
     636                        'GIF Create' => 'GIF',
     637                        'JPEG'       => 'JPEG',
     638                        'PNG'        => 'PNG',
     639                        'WebP'       => 'WebP',
     640                        'BMP'        => 'BMP',
     641                        'AVIF'       => 'AVIF',
     642                        'HEIF'       => 'HEIF',
     643                        'TIFF'       => 'TIFF',
     644                        'XPM'        => 'XPM',
     645                );
     646
     647                foreach ( $gd_supported_formats as $format_key => $format ) {
     648                        $index = $format_key . ' Support';
     649                        if ( isset( $gd[ $index ] ) && $gd[ $index ] ) {
     650                                array_push( $gd_image_formats, $format );
     651                        }
     652                }
     653
     654                if ( ! empty( $gd_image_formats ) ) {
     655                        $info['wp-media']['fields']['gd_formats'] = array(
     656                                'label' => __( 'GD supported file formats' ),
     657                                'value' => implode( ', ', $gd_image_formats ),
     658                                'debug' => implode( ', ', $gd_image_formats ),
     659                        );
     660                }
     661
    634662                // Get Ghostscript information, if available.
    635663                if ( function_exists( 'exec' ) ) {
    636664                        $gs = exec( 'gs --version' );