Fix non-square rotations when using the Imagick image editor.
props DH-Shredder. fixes #22663. git-svn-id: https://develop.svn.wordpress.org/trunk@25636 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c3a6047584
commit
e212691d73
@ -352,11 +352,18 @@ class WP_Image_Editor_Imagick extends WP_Image_Editor {
|
|||||||
*/
|
*/
|
||||||
try {
|
try {
|
||||||
$this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
|
$this->image->rotateImage( new ImagickPixel('none'), 360-$angle );
|
||||||
|
|
||||||
|
// Since this changes the dimensions of the image, update the size.
|
||||||
|
$result = $this->update_size();
|
||||||
|
if ( is_wp_error( $result ) )
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
$this->image->setImagePage( $this->size['width'], $this->size['height'], 0, 0 );
|
||||||
}
|
}
|
||||||
catch ( Exception $e ) {
|
catch ( Exception $e ) {
|
||||||
return new WP_Error( 'image_rotate_error', $e->getMessage() );
|
return new WP_Error( 'image_rotate_error', $e->getMessage() );
|
||||||
}
|
}
|
||||||
return $this->update_size();
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user