Changeset 26645 for trunk/src/wp-includes/class-wp-image-editor-imagick.php
- Timestamp:
- 12/04/2013 10:48:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-image-editor-imagick.php
r25728 r26645 120 120 return new WP_Error( 'error_loading_image', __('File doesn’t exist?'), $this->file ); 121 121 122 /** This filter is documented in wp-includes/class-wp-image-editor-imagick.php */ 122 123 // Even though Imagick uses less PHP memory than GD, set higher limit for users that have low PHP.ini limits 123 124 @ini_set( 'memory_limit', apply_filters( 'image_memory_limit', WP_MAX_MEMORY_LIMIT ) ); … … 143 144 return $updated_size; 144 145 145 return $this->set_quality( );146 return $this->set_quality( $this->quality ); 146 147 } 147 148 … … 153 154 * 154 155 * @param int $quality Compression Quality. Range: [1,100] 155 * @return boolean|WP_Error 156 * @return boolean|WP_Error True if set successfully; WP_Error on failure. 156 157 */ 157 158 public function set_quality( $quality = null ) { 158 if ( !$quality ) 159 $quality_result = parent::set_quality( $quality ); 160 if ( is_wp_error( $quality_result ) ) { 161 return $quality_result; 162 } else { 159 163 $quality = $this->quality; 160 161 try { 162 if( 'image/jpeg' == $this->mime_type ) { 163 $this->image->setImageCompressionQuality( apply_filters( 'jpeg_quality', $quality, 'image_resize' ) ); 164 } 165 166 try { 167 if ( 'image/jpeg' == $this->mime_type ) { 168 $this->image->setImageCompressionQuality( $quality ); 164 169 $this->image->setImageCompression( imagick::COMPRESSION_JPEG ); 165 170 } … … 172 177 } 173 178 174 return parent::set_quality( $quality );179 return true; 175 180 } 176 181 … … 448 453 @ chmod( $filename, $perms ); 449 454 455 /** This filter is documented in wp-includes/class-wp-image-editor-gd.php */ 450 456 return array( 451 'path' => $filename,452 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),453 'width' => $this->size['width'],454 'height' => $this->size['height'],457 'path' => $filename, 458 'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ), 459 'width' => $this->size['width'], 460 'height' => $this->size['height'], 455 461 'mime-type' => $mime_type, 456 462 );
Note: See TracChangeset
for help on using the changeset viewer.