AWARE [SYSTEMS] Imaging expertise for the Delphi developer
AWare Systems, Imaging expertise for the Delphi developer, Home TIFF and LibTiff Mailing List Archive

LibTiff Mailing List

TIFF and LibTiff Mailing List Archive
November 2008

Previous Thread
Next Thread

Previous by Thread
Next by Thread

Previous by Date
Next by Date

Contact

The TIFF Mailing List Homepage
This list is run by Frank Warmerdam
Archive maintained by AWare Systems



Valid HTML 4.01!



Thread

2008.11.26 15:15 "TIFFWriteEncodedStrip LZW compression failing for certain input", by <paavo@osa.pri.ee>
2008.11.26 15:53 "Re: TIFFWriteEncodedStrip LZW compression failing for certain input", by Frank Warmerdam
2008.11.27 10:49 "Re: TIFFWriteEncodedStrip LZW compression failing for certain input", by <paavo@osa.pri.ee>
2008.11.27 13:23 "Re: TIFFWriteEncodedStrip LZW compression failing for certain input", by Frank Warmerdam

2008.11.27 10:49 "Re: TIFFWriteEncodedStrip LZW compression failing for certain input", by <paavo@osa.pri.ee>

> In short, my problem is that TIFFWriteEncodedStrip in LZW mode is
> producing corrupt output for some image content.

I have found out it was my mistake. I read the strip back in by
TIFFReadRawStrip(), but did call the wrong function to determine the
initial buffer size (TIFFStripSize() instead of TIFFRawStripSize()). Thus,
if the compressed data was larger than the original, I failed to capture
the extra bytes.

The question remains why the image is not compressable by LZW, is it some
fundamental problem with the algorithm? For example, gzip is able to
compress the uncompressed TIFF file with the same image 128 times!

>
> The image is a 16bpp grayscale image of size 1400x1400. It is filled by
> numbers according to formula "x*10+y*10", where x and y are the pixel
> coordinates 0..1399. I attempt to write the whole image in a single strip.

Paavo