Page 1 of 1

MagickCore RotateImage

Posted: 2010-06-08T07:51:20-07:00
by nicolas1
Hi,

I have a problem, when I call MagickCore::RotateImage with for example -90 degrees, the return image size is not adjusted according to rotation (for example, swap width and height of result image). This results in distortion.... and the method seems to be useless with that feature. How could I call this method to get the image with correct dimensions?

ImageMagick-6.5.0-1

Thanks,

Re: MagickCore RotateImage

Posted: 2010-06-08T09:04:51-07:00
by fmw42
try +distort SRT

see http://www.imagemagick.org/Usage/distorts/#srt

I don't know the API equivalents.

Re: MagickCore RotateImage

Posted: 2010-06-08T10:20:59-07:00
by magick
Are you using the call properly. Here's an example:
  • rotate_image = RotateImage(image, 90, exception);
    printf("%lu %lu => %lu %lu\n", image->columns, image->rows, rotate_image->columns, rotate_image->rows);

Re: MagickCore RotateImage

Posted: 2010-06-09T05:15:51-07:00
by nicolas1
yes, my fault.

RotateImage adjusts image result dimensions.

Re: MagickCore RotateImage

Posted: 2010-06-14T18:54:00-07:00
by anthony
Their are ways of fixing the rotated image to bring it back to the original size.
See IM examples, Simple Image Warping, Rotating Images
http://www.imagemagick.org/Usage/warping/#rotate

However you may prefer to use the newer Distort Images, which uses a different technique and provides more control of the pixel level distortion that any form of rotation generates
Distorting Images, Scale-Rotate-Translate (SRT) Distortion
http://www.imagemagick.org/Usage/distorts/#srt