2004.03.15 23:58 "[Tiff] libtiff and streams", by Dimitar Gospodinov

2004.03.16 08:00 "Re: [Tiff] libtiff and streams", by Rob van den Tillaart

Hi,

A search on the RFC list on www.ietf.org gave the following TIFF hits:

2302 Tag Image File Format (TIFF) - image/tiff MIME Sub-type Registration. G. Parsons, J. Rafferty, S. Zilles. March 1998. (Format: TXT=14375 bytes) (Obsoleted by RFC3302) (Status: PROPOSED STANDARD)

2306 Tag Image File Format (TIFF) - F Profile for Facsimile. G. Parsons, J. Rafferty. March 1998. (Format: TXT=59358 bytes) (Status: INFORMATIONAL)

3250 Tag Image File Format Fax eXtended (TIFF-FX) - image/tiff-fx MIME Sub-type Registration. L. McIntyre, G. Parsons, J. Rafferty. September 2002. (Format: TXT=17876 bytes) (Status: PROPOSED STANDARD)

3302 Tag Image File Format (TIFF) - image/tiff MIME Sub-type Registration. G. Parsons, J. Rafferty. September 2002. (Format: TXT=15183 bytes) (Obsoletes RFC2302) (Status: PROPOSED STANDARD)

The RFC 2306 describes some guidelines to structure TIFF's:

http://www.faqs.org/rfcs/rfc2306.html section 3.1.4,

from the RFC:

                   +-----------------------+
                   |         Header        |------------+
                   +-----------------------+            | First IFD
                   |      IFD (page 0)     | <----------+ Offset
               +---|                       |------------+
               |   |                       |--+         |
         Value |   +-----------------------+  |         |
        Offset +-->|      Long Values      |  |         |
                   +-----------------------|  | Strip   |
                   |  Image Data (page 0)  |<-+ Offset  |
                   +-----------------------+            | Next IFD
                   |      IFD (page 1)     | <----------+ Offset
               +---|                       |------------+
               |   |                       |--+         |
         Value |   +-----------------------+  |         |
        Offset +-->|      Long Values      |  |         |
                   +-----------------------|  | Strip   |
                   |  Image Data (page 1)  |<-+ Offset  |
                   +-----------------------+            | Next IFD
                   |      IFD (page 2)     | <----------+ Offset
                   +-----------------------+
                   |          :            |
                   |          :            |

       Figure 3.1     TIFF-F Minimum Subset File Structure

As far as I understand the RFC, images following these extra TIFF-F rules can be processed in a stream. However as stated in an earlier mail on this topic if the application has to go random through the pages you will have to buffer things.

So if you want to do streaming you should have a TIFF_2_TIFF-F normalizer in the front of the pipeline and every filter in the pipeline should write according to TIFF-F. But as stated in the RFC the filters should be able to read non TIFF-F conforming TIFF format to be more generic.

Other method to get streaming:

Besides using a normalizer to convert TIFF 2 TIFF-F there is always the option to make a pipeline of single page tiffs and split any multipage at the beginning of the pipeline. Drawback is that you must think of a way to mark the end of stream.

I can imagine a file consisting of a TIFFheader with a null pointer to the first IFD.Or just one IFD with no information in it. I do not know if these are within the spec. One IFD with a new tag marking end of stream should be.

So far my 2 cents,

regards,
rob tillaart