Page 1 of 1

possible bugs with subsection and cropping IM 6.4.2-4

Posted: 2009-05-11T10:15:07-07:00
by fmw42
IM 6.4.2-4 Q16 Mac OSX Tiger

I ran into these issues when trying to extract the last row and column from an image, BUT using the wrong offset that was one pixel outside the bounds of the image. I expected an error message and no image to be generated. I do not know if these are what you would expect or want to have happen, but I thought I would pass this on.

identify rose:
rose:=>ROSE ROSE 70x46 70x46+0+0 8-bit DirectClass 9.45kb

Try to get bottom row, but actually +46 is one row past the bottom
convert rose:[70x1+0+46] rose_bottom.png
convert: No IDATs written into file `rose_bottom.png' @ png.c/PNGErrorHandler/1412.

The above produces an image that cannot be opened

Try to get right column, but actually +70 is one column past the right side
convert rose:[1x46+70+0] rose_right.png

The above does not give an error and produces and image identical to the original

Thus I am getting somewhat inconsistent kinds of error/results

Re: possible bugs with subsection and cropping IM 6.4.2-4

Posted: 2009-05-11T10:43:29-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.5.2-5 Beta to fix the problem. Thanks.

Re: possible bugs with subsection and cropping IM 6.4.2-4

Posted: 2009-05-11T22:19:00-07:00
by anthony
NOTE you probably should have quotes around the square brackets, to protect them from some shells. However I verified that the problem happens.

What should have happens is you get an crop error, and a single pixel 'NULL:' missed image should be generated.

However even the normal crop for some reason fails with the wrong error...

Code: Select all

   convert rose:  -crop 70x1+0+46 rose_bottom.png
convert: No IDATs written into file `rose_bottom.png' @ png.c/PNGErrorHandler/1412.
Looks like a fatal error in the PNG coder module.

If I take out the PNG save,

Code: Select all

        convert rose:  -crop 70x1+0+47 null:
I get no error or even a warning!!!! That is also bug in IM looks like a bounray condition failure as changing 46 to 47 produces the correct error...

Code: Select all

convert rose:  -crop 70x1+0+47 null:
convert: geometry does not contain image `ROSE' @ transform.c/CropImage/507.