2012.01.26 16:41 "[Tiff] TIFFClientOpen() output stream/encoding behaviour", by Christopher Cameron

2012.01.26 20:30 "Re: [Tiff] TIFFClientOpen() output stream/encoding behaviour", by Thomas Richter

On 26.01.2012 17:41, Christopher Cameron wrote:

I am writing a TIFF codec for an image library. We have decided to use libtiff as the basis for that codec.

The image library provides access to an output stream which can be written to only forward. Once data is written, it's written and the stream pointer can only go forward.

I am noticing however that libtiff will occasionally attempt to seek back to data, and occasionally ask for the size of the file, while encoding. Is there a way to disable this random access for output streams? Perhaps by enabling something where libtiff will cache the metadata that has already been written? Or by forcing libtiff to write all the metadata first, followed by the image data?

Honestly, if these are your constraints, then libTIFF is probably not the best choice.

Can you get away with writing uncompressed data? If so, I suggest just to write the TIFF header and IFD yourself and precompute the offsets, then write the raw data. Unless you have exotic precisions or formats, this is not a big deal.

If it is of any help, the JPEG XR reference software I'm maintaining does exactly that. As the software is available, I would have no problem providing the sources. Of course, you would still need to extract the code you need.

So long,
        Thomas