Ticket #21668: 21668.2.patch

File 21668.2.patch, 2.0 KB (added by SergeyBiryukov, 9 months ago)
  • wp-admin/includes/image-edit.php

     
    223223 
    224224        switch ( $mime_type ) { 
    225225                case 'image/jpeg': 
     226                        if ( function_exists( 'imageinterlace' ) ) 
     227                                imageinterlace( $image, 1 ); 
    226228                        return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) ); 
    227229                case 'image/png': 
    228230                        return imagepng($image, $filename); 
  • wp-admin/includes/image.php

     
    9292 
    9393        $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) ); 
    9494 
    95         if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) ) 
     95        if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) ) { 
    9696                return $dst_file; 
    97         elseif ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) ) 
    98                 return $dst_file; 
    99         else 
    100                 return false; 
     97        } else { 
     98                if ( function_exists( 'imageinterlace' ) ) 
     99                        imageinterlace( $dst, 1 ); 
     100                if ( imagejpeg( $dst, $dst_file, apply_filters( 'jpeg_quality', 90, 'wp_crop_image' ) ) ) 
     101                        return $dst_file; 
     102        } 
     103 
     104        return false; 
    101105} 
    102106 
    103107/** 
  • wp-includes/media.php

     
    464464                // all other formats are converted to jpg 
    465465                if ( 'jpg' != $ext && 'jpeg' != $ext ) 
    466466                        $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; 
     467 
     468                if ( function_exists( 'imageinterlace' ) ) 
     469                        imageinterlace( $newimage, 1 ); 
     470 
    467471                if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) 
    468472                        return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); 
    469473        }