2014.05.08 23:14 "[Tiff] what's up with all the seeking?", by Jeff Breidenbach

2014.05.09 18:46 "Re: [Tiff] what's up with all the seeking?", by Even Rouault

Le vendredi 09 mai 2014 16:03:30, Bob Friesenhahn a écrit:

Is TIFF fundamentally incompatible with streaming?

In order for TIFF to be "streamed" you would need to implement an I/O layer for libtiff to use and the I/O layer would need to add any necessary buffering so that it buffers all data up to any requested seek or read offset. It might be necessary to buffer the entire image data.

A simple workaround is to read the input into a temporary file.

I agree with others that, generally, the TIFF format isn't not compatible with streaming.

That said, if you have full control on how libtiff is used (and if you master its behaviour) to produce the TIFF and how it will be read, it *might* be streamable.

For example I've used GDAL to produced a tiled uncompressed TIFF (tile dimension:256x256), 3 bands, contiguous planar config: out.tif If I use GDAL translate to read it and produce a TIFF with exact configuration, the read-pattern used by the GDAL I/O will be compatible with streaming:

$ cat out.tif | gdal_translate /vsistdin/ out2.tif -co tiled=yes Input file size is 21600, 21600 0...10...20...30...40...50...60...70...80...90...100 - done.

But that's really a particular case.

I didn't manage to produce for example a JPEG-compressed TIFF that has that priority. For some reason (probably due to the writing of the JPEGTABLES), the TIFF directory gets rewritten at the end of the file instead of being at the beginning. And you loose streaming capability.

Even

--
Geospatial professional services
http://even.rouault.free.fr/services.html