Ticket #21668: 21668.4.patch
File 21668.4.patch, 3.3 KB (added by , 11 years ago) |
---|
-
wp-admin/includes/image-edit.php
217 217 switch ( $mime_type ) { 218 218 case 'image/jpeg': 219 219 header( 'Content-Type: image/jpeg' ); 220 if ( function_exists('imageinterlace') ) 221 imageinterlace( $image, true ); 220 222 return imagejpeg( $image, null, 90 ); 221 223 case 'image/png': 222 224 header( 'Content-Type: image/png' ); … … 259 261 260 262 switch ( $mime_type ) { 261 263 case 'image/jpeg': 264 if ( function_exists('imageinterlace') ) 265 imageinterlace( $image, true ); 262 266 return imagejpeg( $image, $filename, apply_filters( 'jpeg_quality', 90, 'edit_image' ) ); 263 267 case 'image/png': 264 268 return imagepng( $image, $filename ); -
wp-includes/class-wp-image-editor-gd.php
357 357 return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 358 358 } 359 359 elseif ( 'image/jpeg' == $mime_type ) { 360 if ( function_exists('imageinterlace') ) 361 imageinterlace( $image, true ); 360 362 if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, apply_filters( 'jpeg_quality', $this->quality, 'image_resize' ) ) ) ) 361 363 return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 362 364 } … … 398 400 return imagegif( $this->image ); 399 401 default: 400 402 header( 'Content-Type: image/jpeg' ); 403 if ( function_exists('imageinterlace') ) 404 imageinterlace( $this->image, true ); 401 405 return imagejpeg( $this->image, null, $this->quality ); 402 406 } 403 407 } -
wp-includes/class-wp-image-editor-imagick.php
55 55 'getimageblob', 56 56 'getimagegeometry', 57 57 'getimageformat', 58 'getinterlacescheme', 58 59 'setimageformat', 59 60 'setimagecompression', 60 61 'setimagecompressionquality', 61 62 'setimagepage', 63 'setinterlacescheme', 62 64 'scaleimage', 63 65 'cropimage', 64 66 'rotateimage', … … 67 69 ); 68 70 69 71 // Now, test for deep requirements within Imagick. 70 if ( ! defined( 'imagick::COMPRESSION_JPEG' ) )72 if ( ! defined( 'imagick::COMPRESSION_JPEG' ) || ! defined( 'Imagick::INTERLACE_PLANE') ) 71 73 return false; 72 74 73 75 if ( array_diff( $required_methods, get_class_methods( 'Imagick' ) ) ) … … 420 422 try { 421 423 // Store initial Format 422 424 $orig_format = $this->image->getImageFormat(); 425 $orig_interlace = $this->image->getImageInterlaceScheme(); 423 426 424 427 $this->image->setImageFormat( strtoupper( $this->get_extension( $mime_type ) ) ); 428 $this->image->setInterlaceScheme( Imagick::INTERLACE_PLANE ); 425 429 $this->make_image( $filename, array( $image, 'writeImage' ), array( $filename ) ); 426 430 427 431 // Reset original Format 428 432 $this->image->setImageFormat( $orig_format ); 433 $this->image->setInterlaceScheme( $orig_interlace ); 429 434 } 430 435 catch ( Exception $e ) { 431 436 return new WP_Error( 'image_save_error', $e->getMessage(), $filename );