Wrong page rotation on Rotate 180 IM: 7.0.4-4
Posted: 2017-01-17T10:08:17-07:00
Hello,
I've got a problem when rotating an image by 180°the image effectively rotate by 180°but the Page does not rotate by 180°, instead it rotate by 90°.
After some investigation in the source code I think that I found the source of the problem.
On a rotation of 180° the function that perform the actual rotation is "IntegralRotateImage" MagicCore/shear.c.
A rotation of 180° is transformed in a "rotation" of "2" when passed to "IntegralRotateImage".
In the body of the function there is a switch on the variable "rotation", in the case where "rotation == 2" we find the following code
So we are in fact in the right case for our value of "rotation".
Here come the problem at the end of the case we find the following code:
But when rotating an image by 180° you don't need to swap the width and the height ... this is right on an 90° rotation.
I hope that this will be able to help you solve the problem
I've got a problem when rotating an image by 180°the image effectively rotate by 180°but the Page does not rotate by 180°, instead it rotate by 90°.
After some investigation in the source code I think that I found the source of the problem.
On a rotation of 180° the function that perform the actual rotation is "IntegralRotateImage" MagicCore/shear.c.
A rotation of 180° is transformed in a "rotation" of "2" when passed to "IntegralRotateImage".
In the body of the function there is a switch on the variable "rotation", in the case where "rotation == 2" we find the following code
Code: Select all
case 2:
{
register ssize_t
y;
/*
Rotate 180 degrees.
*/
Here come the problem at the end of the case we find the following code:
Code: Select all
Swap(page.width,page.height);
Swap(page.x,page.y);
I hope that this will be able to help you solve the problem