2010.03.02 20:38 "[Tiff] New Commiter", by Frank Warmerdam

2010.04.01 21:12 "[Tiff] TIFFReadScanline and large compressed one-strip files", by Frank Warmerdam

Folks,

I have an LZW compressed TIFF file of 290MB or so with the whole image in one strip. Reading the file with the TIFFReadScanline() function causes the entire 280MB of compressed data to be loaded into memory at the point the first scanline is read.

My client is finding that in some cases on 32bit systems there isn't 290MB of contiguous memory available and would like a way avoiding prereading the whole strip.

Does anyone have any suggestions for this?

I see that currently TIFFReadScanline() calls TIFFSeek() which loads the appropriate data into the working buffer. I'm wondering if I could load just part of the data into the raw buffer based on knowledge of what scanline I want. Perhaps loading enough raw data that I'm guaranteed to satisfy all the raw data needed for one scanline (say 2*uncompressed size plus 500 bytes).

I'm concerned that I would need to complicate the management of the currently loaded raw data considerably to handle this sort of rolling buffering. Does it seem ill advised to even try?

Best regards,
--
---------------------------------------+--------------------------------------

I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam@pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam

and watch the world go round - Rush    | Geospatial Programmer for Rent