WordPress.org

Make WordPress Core

Ticket #10531: naming-10531.patch

File naming-10531.patch, 2.1 KB (added by stephanreiter, 6 years ago)
  • wp-admin/includes/image.php

     
    109109                $sizes = apply_filters('intermediate_image_sizes', $sizes); 
    110110 
    111111                foreach ($sizes as $size) { 
    112                         $resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop") ); 
     112                        $resized = image_make_intermediate_size( $full_path_file, get_option("{$size}_size_w"), get_option("{$size}_size_h"), get_option("{$size}_crop"), $size ); 
    113113                        if ( $resized ) 
    114114                                $metadata['sizes'][$size] = $resized; 
    115115                } 
  • wp-includes/media.php

     
    385385                $rotated = false; 
    386386                if ( IMAGETYPE_JPEG == $orig_type ) { 
    387387                        // rotate if EXIF 'Orientation' is set 
    388                         $exif = exif_read_data($file, null, true); 
     388                        $exif = is_callable('exif_read_data') ? @exif_read_data($file, null, true) : null; 
    389389                        if ( $exif && isset($exif['IFD0']) && is_array($exif['IFD0']) && isset($exif['IFD0']['Orientation']) ) { 
    390390                                if ( 6 == $exif['IFD0']['Orientation'] ) 
    391391                                        $rotated = rotate_image($newimage, 90); 
     
    432432 * @param bool $crop Optional, default is false. Whether to crop image to specified height and width or resize. 
    433433 * @return bool|array False, if no image was created. Metadata array on success. 
    434434 */ 
    435 function image_make_intermediate_size($file, $width, $height, $crop=false) { 
     435function image_make_intermediate_size($file, $width, $height, $crop=false, $suffix = null) { 
    436436        if ( $width || $height ) { 
    437                 $resized_file = image_resize($file, $width, $height, $crop); 
     437                $resized_file = image_resize($file, $width, $height, $crop, $suffix); 
    438438                if ( !is_wp_error($resized_file) && $resized_file && $info = getimagesize($resized_file) ) { 
    439439                        $resized_file = apply_filters('image_make_intermediate_size', $resized_file); 
    440440                        return array(