1999.05.09 01:34 "TIFFlib bug", by Kevin D. Quitt

1999.05.09 01:34 "TIFFlib bug", by Kevin D. Quitt

I'm trying to track down a bug in TIFFlib, without a whole lot of success, but admittedly with only a couple hours put into it. I have a TIFF file that generates different output from tiff2ps depending on whether it has been passed through tiffcp.

Using ASCII85 encoding, the original file generates a data area of 9087 bytes. If the file is copied through tiffcp, the data area from tiff2ps is 9028 bytes. In the case of ASCII85, this doesn't seem to make a difference - Ghostview shows them both correctly. But still, there shouldn't be different amounts of data. Tiffinfo shows identical information.

But I have modified tiff2ps to embed the CCITT Group IV compressed data directly in the PostScript file. This program works very nicely, except sometimes. There are occasional images that do not translate properly. The change was a trivial one - instead out outputting ASCII85, I just dump the image data to the output, along with the appropriate PostScript wrapper.

In this state, the original file generates a corrupt PostScript file that nothing will read. But the modified file prints properly. There are extra bytes at the tail end of the original file that are causing the problem.

The only difference tiffinfo shows is that the directory is at the beginning of the original file, and at the end of the tiffcp'd file:

TIFF Directory at offset 0x8
    Image Width: 6592 Image Length: 5088
    Resolution: 600, 600 pixels/inch
    Bits/Sample: 1
    Compression Scheme: CCITT Group 4
    Photometric Interpretation: min-is-white
    Orientation: row 0 rhs, col 0 top
    Rows/Strip: 5088
    Planar Configuration: single image plane

F:\tmp> tiffinfo F:\tmp\i.tif

TIFF Directory at offset 0x1bda
    Image Width: 6592 Image Length: 5088
    Resolution: 600, 600 pixels/inch
    Bits/Sample: 1
    Compression Scheme: CCITT Group 4
    Photometric Interpretation: min-is-white
    Orientation: row 0 rhs, col 0 top
    Rows/Strip: 5088
    Planar Configuration: single image plane

I'm hoping to save time by getting a clue. Thanks in advance.

-- 
#include <standard.disclaimer>
 _
Kevin D Quitt  USA 91351-4454           96.37% of all statistics are made up
Per the FCA, this email address may not be added to any commercial mail list