Closed ninze closed 3 years ago
Gd and Imagick drivers leave the image in a different state after rotation.
1.2.1-dev
PHP 7.2.1
Imagick, Gd
$size = $image->getSize(); $image->rotate(45); $image->crop(new Point(0, 0), $size);
Output by Gd driver:
Output by Imagick driver:
The problem is that Imagick does not update image geometry after the rotation. I think a similar issue is described here: https://phpimagick.com/Tutorial/imageGeometryReset
Output from Gd seems to be the correct one.
The solution would be to call setImagePage() inside Imagick driver after the rotation.
setImagePage()
Fixed by #734
Issue description
Gd and Imagick drivers leave the image in a different state after rotation.
What version of Imagine are you using?
1.2.1-dev
What's the PHP version you are using?
PHP 7.2.1
What's the imaging library you are using [gd/imagick/gmagick/any]?
Imagick, Gd
Minimal PHP code to reproduce the error:
Output by Gd driver:
Output by Imagick driver:
The problem is that Imagick does not update image geometry after the rotation. I think a similar issue is described here: https://phpimagick.com/Tutorial/imageGeometryReset
Output from Gd seems to be the correct one.
The solution would be to call
setImagePage()
inside Imagick driver after the rotation.