2007.12.12 16:20 "[Tiff] JPEGLib: Warning, Application transferred too many scanlines", by Andreas Degert

Hi List,

I'm struggling with libtiff and jpeg compression. When I convert a big PPM-File to TIFF with

ppm2tiff -c jpeg test.ppm test.tiff

and then try to convert it to PDF with

tiff2pdf -n test.tiff -o test.pdf

I get errors:

JPEGLib: Warning, Application transferred too many scanlines. tiff2pdf: Error on decoding strip 0 of test.tiff.

tiff2pdf: An error occurred in converting TIFF test.tiff to PDF test.pdf.

(with no valid PDF file created)

This is with libtiff V 3.8.2 (Debian libtiff4). I compiled libtiff V4 alpha and tiff2pdf with -n seems to work but not without -n (illegal memory access).

In tools/tiff2pdf.c near line 2270 max_striplength is computed from TIFFTAG_STRIPBYTECOUNTS, and then TIFFReadRawStrip() is called which gets the strip size from the tiff header, which seems to be bigger. Why are 2 different methods used? This might also be a security issue. For the moment I just doubled the computed size of max_striplength and it seems to work, but maybe someone can shed a light on the 2 different methods of getting the strip length and we can find the real fix.

thanks
Andreas