TIFF to PCL Conversion broken

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

TIFF to PCL Conversion broken

Post 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
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF to PCL Conversion broken

Post 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.
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF to PCL Conversion broken

Post by magick »

GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post by GeneralHQ »

Sent. Thank you. :)

Robert Lee
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF to PCL Conversion broken

Post 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.
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post 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.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF to PCL Conversion broken

Post by magick »

While we investigate, add -compress RLE to your command line. Does that work? How 'bout -compress none?
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: TIFF to PCL Conversion broken

Post by magick »

The problem is in the delta-compression method, the default. RLE is a compressed format but works fine.
GeneralHQ
Posts: 26
Joined: 2008-07-16T08:01:02-07:00

Re: TIFF to PCL Conversion broken

Post 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");" .
Post Reply