2004.07.29 21:07 "[Tiff] writing to a pipe (better error message needed?)", by Jay Berkenbilt

2004.07.30 04:04 "Re: [Tiff] writing to a pipe (better error message needed?)", by Andrey Kiselev

There's a 3.5-year-old debian "wishlist" bug that boils down to someone wanting to be able to create tiff files to a pipe. I understand the tiff file format well and know that it is full of offsets and lengths, making writing a tiff file in one pass impossible without potentially caching the whole image in memory, particularly when compression is being used.

The error message that libtiff gives when you try to write to a pipe is something like 'Error writing data for field "DocumentName"' (or whichever field it's writing). It might be more clear if TIFFFdOpen (or some lower-level function) immediately failed if you use a non-seekable file descriptor.

Generally speaking, TIFF file cannot be streamed in all possible cases, but sometimes we can write an application which can do that. I have mentioned TIFFCheckpointDirectory() function recently, it can be used to write TIFF directory before the image data. When you will get the directory on receiving side it will be simple to read the whole image. Conclusion: it is possible to write TIFF to pipe using libtiff, but application should take a care of it. It is not possible to pipe any existing TIFF file, but when we create a new file we can do that in the way, adopted for piping.

I may also mention to the user that the PNG file format was designed with writing to a pipe as a design goal, so if this functionality is required, they may want to consider that format.

That is true and should be recommended anyway.

Andrey

Andrey V. Kiselev
Home phone: +7 812 5274898 ICQ# 26871517