Make WordPress Core

Ticket #22663: 22663.in_rotate.diff

File 22663.in_rotate.diff, 815 bytes (added by kirasong, 13 years ago)
  • wp-includes/class-wp-image-editor-imagick.php

    diff --git wp-includes/class-wp-image-editor-imagick.php wp-includes/class-wp-image-editor-imagick.php
    index 03485b5..bd49fdd 100644
    class WP_Image_Editor_Imagick extends WP_Image_Editor { 
    339346                 */
    340347                try {
    341348                        $this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
     349
     350                        // Since this changes the dimensions of the image, update the size.
     351                        $result = $this->update_size();
     352                        if ( is_wp_error( $result ) )
     353                                return $result;
     354
     355                        $this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 );
    342356                }
    343357                catch ( Exception $e ) {
    344358                        return new WP_Error( 'image_rotate_error', $e->getMessage() );
    345359                }
    346                 return $this->update_size();
     360                return true;
    347361        }
    348362
    349363        /**