2005.09.12 21:22 "[Tiff] read-by-scan-line buffers full strip, part 2", by Mark Pilon

2005.09.13 15:34 "RE: [Tiff] read-by-scan-line buffers full strip, part 2", by Mark R. Olin

I still need to handle the problem image - is there some way to implement a 'null' codec to get me the image data so that I can go off to the side and decompress it line-by-line?

or do I even need to implement anything? -- could I just rewrite the compression type for this image as 'none'?

If I understand correctly that you seek access to the compressed strip/tile data, without LibTiff expanding any of it to a complete uncompressed strip/tile, then I think TIFFReadRawStrip and TIFFReadRawTile may be useful. See

> http://www.remotesensing.org/libtiff/man/TIFFReadRawStrip.3tif
> f.html and

http://www.remotesensing.org/libtiff/man/TIFFReadRawTile.3tiff.html.

Of course, using this method, you'll still have allocated memory of a complete compressed strip/tile. Seems like little gain from the substantial effort of writing your own more streaming decompressors to handle the data 'off to the side'.

Joris,

Custom decompression by single scanlines using JPEG would not be possible since the JPEG DCT algorithm is applied on spatial blocks.

This link gives a good illustration

http://ei.cs.vt.edu/~mm/gifs/DCTcodec.html.

However, Mark P. might be able to decode a series of blocks using the TIFFReadRawStrip() approach which might yield 8 scanlines at once (greyscale). I don't know what the organization is for color.

I believe that the DCT is applied to 8x8 blocks in raster order, from top to bottom, left to right. So to get an 8 line decompressed strip from the middle of the raw compressed strip, you'd have to first decompress and discard all compressed data "above" the lines that you wish to get to, just to get to the right place.

Regards,

Mark O.