WordPress.org

Make WordPress Core

Ticket #22438: 22438.diff

File 22438.diff, 763 bytes (added by mdawaffe, 6 years ago)
  • wp-admin/includes/image.php

     
    9898
    9999                $sizes = apply_filters( 'intermediate_image_sizes_advanced', $sizes );
    100100
    101                 $editor = WP_Image_Editor::get_instance( $file );
     101                if ( $sizes ) {
     102                        $editor = WP_Image_Editor::get_instance( $file );
    102103
    103                 if ( ! is_wp_error( $editor ) )
    104                         $metadata['sizes'] = $editor->multi_resize( $sizes );
     104                        if ( ! is_wp_error( $editor ) )
     105                                $metadata['sizes'] = $editor->multi_resize( $sizes );
     106                } else {
     107                        $metadata['sizes'] = array();
     108                }
    105109
    106110                // fetch additional metadata from exif/iptc
    107111                $image_meta = wp_read_image_metadata( $file );