Ticket #26177: 26177.patch
| File 26177.patch, 3.1 KB (added by , 12 years ago) |
|---|
-
wp-includes/class-wp-image-editor-gd.php
87 87 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 88 88 89 89 // Set artificially high because GD uses uncompressed images in memory 90 /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */ 90 91 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); 91 92 $this->image = @imagecreatefromstring( file_get_contents( $this->file ) ); 92 93 … … 361 362 return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 362 363 } 363 364 elseif ( 'image/jpeg' == $mime_type ) { 365 /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */ 364 366 if ( ! $this->make_image( $filename, 'imagejpeg', array( $image, $filename, apply_filters( 'jpeg_quality', $this->quality, 'image_resize' ) ) ) ) 365 367 return new WP_Error( 'image_save_error', __('Image Editor Save Failed') ); 366 368 } … … 375 377 376 378 return array( 377 379 'path' => $filename, 380 /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */ 378 381 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 379 382 'width' => $this->size['width'], 380 383 'height' => $this->size['height'], -
wp-includes/class-wp-image-editor-imagick.php
119 119 if ( ! is_file( $this->file ) && ! preg_match( '|^https?://|', $this->file ) ) 120 120 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 121 121 122 /** 123 * Filter the memory limit allocated to either GD or Imagick for image manipulation. 124 * 125 * @since 3.2.0 126 * 127 * @param string Maximum memory limit to allocate (default is 256M). 128 */ 122 129 // Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits 123 130 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); 124 131 … … 160 167 161 168 try { 162 169 if( 'image/jpeg' == $this->mime_type ) { 170 /** 171 * Filter the quality of the JPEG before it's saved. 172 * 173 * @since 2.5.0 174 * 175 * @param int $quality Quality level between 0 (low) and 100 (high) of the JPEG. 176 * @param string The context of the filter. 177 */ 163 178 $this->image->setImageCompressionQuality( apply_filters( 'jpeg_quality', $quality, 'image_resize' ) ); 164 179 $this->image->setImageCompression( imagick::COMPRESSION_JPEG ); 165 180 } … … 449 464 450 465 return array( 451 466 'path' => $filename, 467 /** 468 * Filter the name of the saved image file. 469 * 470 * @since 2.6.0 471 * 472 * @param string $filename Name of the file. 473 */ 452 474 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 453 475 'width' => $this->size['width'], 454 476 'height' => $this->size['height'],