Corrupt Images With B&W Conversion
Posted: 2010-10-10T18:54:22-07:00
I have found a bug that affects ImageMagic randomly when converting to a B&W image.
The bug can be reproduced with the sample images PIC1.BMP and PIC2.BMP found in the ZIP file at this location:
http://drop.io/ImageMagickBugSampleImages
At this location you will find ImageMagickBugSampleImages.zip for download.
If you use these two commands to convert the images to bitonal TIF files:
convert -format tif -compress group4 pic1.bmp pic1.tif
convert -format tif -compress group4 pic2.bmp pic2.tif
(I have also included thed PIC1.TIF and PIC2.TIF output files in my ZIP file).
You will notice that PIC1.TIF is all white. PIC2.TIF is what is expected. Randomly changing PIC1.BMP stops the error from occurring.
Currently I get this bug in about 1 in 100 files I'm converting.
Adding other parameters like -DEPTH or -COLORS will change which images are affected by the bug (along with the order of the commands on the command-line) but there doesn't seem to be a way to make this bug stop affecting my conversion scripts.
I am using release ImageMagick-6.6.4-Q16 on Win32 but can reproduce this on older versions also.
Can somebody please explain why this error is occurring?
Thanks
The bug can be reproduced with the sample images PIC1.BMP and PIC2.BMP found in the ZIP file at this location:
http://drop.io/ImageMagickBugSampleImages
At this location you will find ImageMagickBugSampleImages.zip for download.
If you use these two commands to convert the images to bitonal TIF files:
convert -format tif -compress group4 pic1.bmp pic1.tif
convert -format tif -compress group4 pic2.bmp pic2.tif
(I have also included thed PIC1.TIF and PIC2.TIF output files in my ZIP file).
You will notice that PIC1.TIF is all white. PIC2.TIF is what is expected. Randomly changing PIC1.BMP stops the error from occurring.
Currently I get this bug in about 1 in 100 files I'm converting.
Adding other parameters like -DEPTH or -COLORS will change which images are affected by the bug (along with the order of the commands on the command-line) but there doesn't seem to be a way to make this bug stop affecting my conversion scripts.
I am using release ImageMagick-6.6.4-Q16 on Win32 but can reproduce this on older versions also.
Can somebody please explain why this error is occurring?
Thanks