Package: libmagick9-dev
Version: 7:6.2.4.5.dfsg1-0.14

In a C program I'm writing that uses the imagemagick library API, when I
crop an image by calling MagickCropImage and then I manipulate it
further, I obtain incorrect results. As far as I can tell, the image
does get cropped (if I save it it's ok), but the geometry information in
the MagickWand is NOT changed to reflect the cropping -- i.e., Magick*
functions believe that the image still has the original size.

I'm attaching two test cases and an image that should serve as input for
them (but any other image 300x300 or larger should do).

In the first test, I crop the same image twice:

  MagickCropImage(wand, 300, 300, 50, 50);
  MagickCropImage(wand, 250, 250, 0, 0);

The resulting image should be 250x250 (from 50 to 300 of the original
image along both directions). Instead it's 200x200 (from 50 to 250). It
seems that the second crop is still applied to the original image, not
to the cropped one; the resulting image is the _intersection_ of the two
cropped regions.

In the second test, I crop a 50x10 portion of the image and then use a
PixelIterator and a PixelWand to loop over pixels. For each row the
program prints the line width (as set by PixelGetNextIterationRow): it
should be 50. Instead it's 500. Again, it seems that operations
following the crop are applied to the original image.

My system is a 32-bit PC running Etch. The kernel is the stock kernel in
Etch, same for libc and all packages that might be involved. I don't
know whether the problem is also present in Lenny or Sid.

Thanks
 Gerardo Ballabio

Attachment: bug1.c
Description: bug1.c

Attachment: bug2.c
Description: bug2.c

<<attachment: in.png>>

Reply via email to