Ticket #21668: 21668.2.patch
File 21668.2.patch, 2.0 KB (added by , 12 years ago) |
---|
-
wp-admin/includes/image-edit.php
223 223 224 224 switch ( $mime_type ) { 225 225 case 'image/jpeg': 226 if ( function_exists( 'imageinterlace' ) ) 227 imageinterlace( $image, 1 ); 226 228 return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) ); 227 229 case 'image/png': 228 230 return imagepng($image, $filename); -
wp-admin/includes/image.php
92 92 93 93 $dst_file = dirname( $dst_file ) . '/' . wp_unique_filename( dirname( $dst_file ), basename( $dst_file ) ); 94 94 95 if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) ) 95 if ( 'image/png' == $image_type && imagepng( $dst, $dst_file ) ) { 96 96 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; 101 105 } 102 106 103 107 /** -
wp-includes/media.php
464 464 // all other formats are converted to jpg 465 465 if ( 'jpg' != $ext && 'jpeg' != $ext ) 466 466 $destfilename = "{$dir}/{$name}-{$suffix}.jpg"; 467 468 if ( function_exists( 'imageinterlace' ) ) 469 imageinterlace( $newimage, 1 ); 470 467 471 if ( !imagejpeg( $newimage, $destfilename, apply_filters( 'jpeg_quality', $jpeg_quality, 'image_resize' ) ) ) 468 472 return new WP_Error('resize_path_invalid', __( 'Resize path invalid' )); 469 473 }