Ticket #28634: 28634.4.diff
File 28634.4.diff, 1.3 KB (added by , 9 years ago) |
---|
-
src/wp-includes/class-wp-image-editor-imagick.php
310 310 $size_data['crop'] = false; 311 311 } 312 312 313 /** 314 * Filter whether to strip the image exif data when resizing an image using Imagick. 315 * 316 * Can significantly reduce images file fizes for small/heavily compressed images. 317 * Applies only when using `Imagick` for image manipulation. GD already strips exif data. 318 * 319 * @param bool Whether to strip image image exif data. Default false. 320 * @param string Image size identifier. 321 */ 322 if ( apply_filters( 'image_strip_exif', false, $size ) ) { 323 $this->strip_exif(); 324 } 325 313 326 $resize_result = $this->resize( $size_data['width'], $size_data['height'], $size_data['crop'] ); 314 327 $duplicate = ( ( $orig_size['width'] == $size_data['width'] ) && ( $orig_size['height'] == $size_data['height'] ) ); 315 328 … … 530 543 531 544 return true; 532 545 } 546 547 public function strip_exif() { 548 $profiles = $this->image->getImageProfiles( 'icc', true ); 549 550 $this->image->stripImage(); 551 552 if ( ! empty( $profiles ) ) { 553 $this->image->profileImage( 'icc', $profiles['icc'] ); 554 } 555 } 556 533 557 }