Ticket #37140: 37140.4.patch
File 37140.4.patch, 923 bytes (added by , 7 years ago) |
---|
-
src/wp-includes/class-wp-image-editor-imagick.php
175 175 return $updated_size; 176 176 } 177 177 178 if ( 'image/jpeg' === $this->mime_type ) { 179 $this->reset_orientation(); 180 } 181 178 182 return $this->set_quality(); 179 183 } 180 184 … … 761 765 } 762 766 } 763 767 768 /** 769 * Reset the exif image orientation data. 770 * 771 * @since 4.7.3 772 * @access protected 773 * 774 * @return true|WP_Error True if successful or WP_Error on failure. 775 */ 776 protected function reset_orientation() { 777 try { 778 $this->image->setImageOrientation( Imagick::ORIENTATION_TOPLEFT ); 779 } 780 catch ( Exception $e ) { 781 return new WP_Error( 'image_reset_orientation_error', $e->getMessage() ); 782 } 783 784 return true; 785 } 786 764 787 }