Page 1 of 1

TIFF to PCL Conversion broken

Posted: 2010-10-28T10:20:30-07:00
by GeneralHQ
I have put together a small test program that I believe points out a bug in the latest version of ImageMagick, and would like to submit it for debugging and fixing. How do I do that?

This progam uses ImageMagick to read in a TIFF image file, does some simple processing on it (cropping and sizing), then converts the image to PCL format, and saves it as a PCL file ready for printing.

This program works just fine using an older version of ImageMagick, but is broken in the latest release. Specifically, it works just fine using ImageMagick Version 6.4.3, but fails using the latest Version 6.6.5. It fails by either causing a program fault, a memory buffer overflow (malloc of X bytes but using X+1) or by corrupting the stack causing the program to trap upon returning from the calling function. Either way, it is not good. ;-)

We have been using ImageMagick to perform this particular function for years, and are interested in upgrading to the latest version of ImageMagick, but will be unable to do so if the latest version no longer works properly. So, we are interested in getting this fixed.

Thank you,
Robert Lee
rlee@RosettaTechnologies.com

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T06:44:38-07:00
by GeneralHQ
Is anyone willing to look into this issue?

Loading a TIFF image and converting it to PCL seems to be broken and causes traps inside of ImageMagick in the latest 6.6.5 build, whereas it worked in earlier 6.4.3 releases.

Robert Lee.

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T08:39:39-07:00
by magick
You need to provide a test case before we can investigate further. TIFF to PCL conversion works for us. We'll need a URL to your TIFF image and the command line you use and a summary of how it fails. We need to reproduce the problem before we can comment further.

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T08:43:34-07:00
by GeneralHQ
Is there somewhere I can e-mail a zip file that contains my test case program along with the tiff file I am using? Sorry, I don't have a URL to post it at.

Robert

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T09:04:14-07:00
by magick

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T09:35:14-07:00
by GeneralHQ
Sent. Thank you. :)

Robert Lee

Re: TIFF to PCL Conversion broken

Posted: 2010-11-01T11:05:14-07:00
by magick
We typically do not debug user software because the bug could very well be in your program rather than ImageMagick (e.g. such as memory corruption). Can you repeat the problem from the command line (e.g. convert image.tif image.pcl)? If not, we may take a look at your source code but we're not keen to do so.

Re: TIFF to PCL Conversion broken

Posted: 2010-11-02T07:20:31-07:00
by GeneralHQ
Yes, I can reproduce the problem from the command line.

In the package I e-mailed in, I included two TIFF images - image-1.tiff and image-8.tiff.

If I type:

convert image-1.tiff image-1.pcl

I get a trap regarding heap corruption, similar to the problem I am seeing in my program.
Again, this worked fine back under Version 6.4.3 but fails with the latest 6.6.5.

Robert.

Re: TIFF to PCL Conversion broken

Posted: 2010-11-02T08:48:09-07:00
by magick
While we investigate, add -compress RLE to your command line. Does that work? How 'bout -compress none?

Re: TIFF to PCL Conversion broken

Posted: 2010-11-02T08:55:39-07:00
by GeneralHQ
convert image-1.tiff -compress RLE image-1.pcl
and
convert image-1.tiff -compress NONE image-1.pcl

both seem to execute fine without any internal traps.

So it seems to be in the PCL compression routine, I gather.

Robert

Re: TIFF to PCL Conversion broken

Posted: 2010-11-02T09:15:08-07:00
by magick
The problem is in the delta-compression method, the default. RLE is a compressed format but works fine.

Re: TIFF to PCL Conversion broken

Posted: 2010-11-08T13:39:08-07:00
by GeneralHQ
I see that there has been an update to ImageMagick this weekend, to Version 6.6.5-7.

Using this version, it seems like the memory corruption issue has been fixed, but it still does not work correctly.

Manually using the convert command line tool to convert the two images I sent in no longer causes the convert program to crash due to corrupted memory, but the resultant PCL file is still useless. It is all black. Just one big black blob.

Using the program I sent in, I still get an exception thrown by ImageMagick when I try to do the convert to PCL, with the command "tiffimg.magick("PCL");" .