rfc-3949

File Format for Internet Fax

R. Buckley, D. Venable, L. McIntyre, G. Parsons, J. Rafferty
date2005-02 streamIETF areaapp wgfax statusDRAFT STANDARD pages84 canonicalhttps://www.rfc-editor.org/rfc/rfc3949 doi10.17487/RFC3949
This document is a revised version of RFC 2301. The revisions, summarized in the list attached as Annex B, are based on discussions and suggestions for improvements that have been made since RFC 2301 was issued in March 1998, and on the results of independent implementations and interoperability testing. This RFC 2301 revision describes the Tag Image File Format (TIFF) representation of image data specified by the International Telecommunication Union (ITU-T) Recommendations for black-and-white and color facsimile. This file format specification is commonly known as TIFF for Fax eXtended (TIFF-FX). It formally defines minimal, extended, and lossless Joint Bi-level Image experts Group (JBIG) profiles (Profiles S, F, J) for black-and-white fax and base JPEG, lossless JBIG, and Mixed Raster Content profiles (Profiles C, L, M) for color and grayscale fax. These profiles correspond to the content of the applicable ITU-T Recommendations. [STANDARDS-TRACK]

obsoletes

Extracted elements (31)

design-rationale §2.1.2

Compression parameters are stored in the compressed data stream rather than in TIFF fields, making the TIFF representation and compressed format specification independent of each other and allowing TIFF to add new compression schemes without format changes.

email

design-rationale §2.2.2

FillOrder=2 (LSB first) is the default for fax because facsimile data appears on the telephone line in bit-reversed order relative to its ITU-T T.4 description, making LSB-first the natural storage order for most fax hardware.

email

design-rationale §3.5

Profile S mandates little-endian byte order and a strict sequential IFD/data ordering to reduce memory requirements and support streaming: a receiver can process the file as it arrives without buffering the entire file.

email

interoperability-note §2.2.4

GlobalParametersIFD and new fax fields (tags 400-405) are not supported by historical TIFF-F readers. Profile S writers SHOULD NOT use these fields.

email

interoperability-note §4.2.1

Not all combinations of XResolution, YResolution, and ImageWidth are legal. Profile F specifies a table of valid combinations (e.g., 200x100 dpi only with width 1728/2048/2432); implementations must restrict to these combinations per T.30.

email

interoperability-note §2.2.2

Per T.4, XResolution values 200 and 204 pixels/inch are equivalent, as are 400 and 408 pixels/inch. If an implementation accepts one member of an equivalency pair it must accept both.

email

interoperability-note §2.2.2

Per T.4, YResolution equivalency pairs are: 98≡100, 196≡200, and 391≡400 pixels/inch. If an application accepts any member of a pair, T.4 requires it to accept both.

email

normative-requirement §3.4 MUST

A 12-bit EOL sequence MUST precede each line of MH-compressed data (Compression=3). EOLs MAY be byte-aligned (fill bits added before each EOL), controlled by T4Options bit 2.

email

normative-requirement §1 MUST

All implementations of TIFF for facsimile MUST implement Profile S (minimal black-and-white), the root of the profile hierarchy. All color implementations MUST also implement Profile C.

email

normative-requirement §1 MUST

An implementation of a particular profile MUST also implement all profiles on the path connecting it to the root node (Profile S). For example, implementing Profile M requires implementing Profiles C and S.

email

normative-requirement §4.2.2 MUST

For MMR-compressed data (Compression=4), each coded strip MUST include an end-of-facsimile-block (EOFB) code at its end. The uncompressed mode bit in T6Options MUST be set to 0 for fax; T6Options must be present and equal 0.

email

normative-requirement §3.5 REQUIRED

For Profile S, the TIFF header SHALL use byte order 'II' (0x4949, little-endian), the first IFD SHALL be at offset 8, and FillOrder SHALL be 2 (LSB first). Profile S only supports ImageWidth=1728.

email

normative-requirement §2.1.3 SHOULD

If GlobalParametersIFD (tag 400) is present, it SHOULD be located in the first IFD immediately following the 8-byte header. In a conflict between GlobalParametersIFD and an image IFD, the image IFD values prevail.

email

normative-requirement §2.1.3 REQUIRED

Implementations reading TIFF-FX files SHALL read multiple IFDs. Only the Mixed Raster Content profile requires child IFDs via the SubIFDs field.

email

normative-requirement §4.2.1 REQUIRED

Profile F readers must support both FillOrder=1 (MSB first) and FillOrder=2 (LSB first). Profile S requires only FillOrder=2. Uncompressed data (Compression=1 or 2) is not allowed in TIFF-F.

email

normative-requirement §3.4.1 MUST

Profile S readers MUST be able to process files without RTCs and SHOULD process files with RTCs. RTCs (6 consecutive EOLs) MAY only be included by writers when EOLs are not byte-aligned (T4Options bit 2 = 0).

email

normative-requirement §3.5 REQUIRED

Profile S SHALL enforce strict file ordering: IFDs in page order, each IFD precedes its image data, image data in page order, XResolution/YResolution long values immediately follow their IFD, and each page's image data MUST be in a single strip.

email

normative-requirement §2.2.2 SHOULD

TIFF-FX writers SHOULD express XResolution and YResolution in inch-based units for consistency with historical practice and to maximize interoperability.

email

normative-requirement §2.1.2 REQUIRED

When an attribute value appears in both the compressed data stream and a TIFF field, the data stream value takes precedence for values required to interpret the stream; the TIFF field value takes precedence for informational values not needed to interpret the stream.

email

protocol-element §2.1.1

An IFD consists of a 2-byte field count, a sequence of 12-byte field entries sorted in ascending tag order, and a 4-byte next-IFD offset (0 if last). All fax profiles represent multi-page documents as a linked list of IFDs with NewSubfileType bit 1 set.

email

protocol-element §2.2.4

CodingMethods field (tag 403, LONG bitmask) identifies all compression methods used in the file: bit 1=MH (T.4 1D), bit 2=MR (T.4 2D), bit 3=MMR (T.6), bit 4=JBIG via T.85, bit 5=Baseline JPEG, bit 6=JBIG color via T.43; limited to 32 standard compression types.

email

protocol-element §2.1.2

Each image is stored as one or more strips within an IFD. Required strip fields are StripOffsets (tag 273), RowsPerStrip (tag 278), and StripByteCounts (tag 279); all strips except the last must contain the same number of scanlines.

email

protocol-element §2.2.4

FaxProfile field (tag 402, BYTE) identifies the applicable TIFF-FX profile: 0=unspecified, 1=Profile S, 2=Profile F, 3=Profile J, 4=Profile C, 5=Profile L, 6=Profile M.

email, registry

protocol-element §2.2.4

GlobalParametersIFD field (tag 400, type IFD/LONG) contains global fax session parameters. Child fields include ProfileType (tag 401), FaxProfile (tag 402), CodingMethods (tag 403), VersionYear (tag 404), and ModeNumber (tag 405).

email

protocol-element §4.3.3

Page-quality fields for Profile F: BadFaxLines (tag 326, count of bad scanlines), CleanFaxData (tag 327, 0=none/1=regenerated/2=unregenerated), ConsecutiveBadFaxLines (tag 328, maximum consecutive bad lines). MUST NOT be written when no page-quality information is available or data is error-corrected.

email

protocol-element §4.1

Profile F (TIFF-F) extends Profile S to support MH, MR (T4Options bit 0=1), and MMR (Compression=4) compression, and page widths of 1728/2048/2432/2592/3072/3648/3456/4096/4864 pixels for multiple paper sizes.

email

protocol-element §8.1

Profile M (Mixed Raster Content, Section 8) uses a 3-layer model — mask (bi-level), foreground (color/grayscale), and background (color/grayscale) — represented as child IFDs linked from a primary IFD via the SubIFDs field. A new StripRowCounts field allows variable scanlines per strip.

email

registry §9

Section 9 references MIME content types image/tiff and image/tiff-fx for use with TIFF-FX files in Internet fax applications, as defined in companion IETF documents.

email, registry

security-consideration §10

Section 10 of RFC 3949 addresses security considerations for the TIFF-FX Internet fax file format. Implementors should treat TIFF-FX parsing as a potential attack surface, as malformed or maliciously crafted files could exploit parsing vulnerabilities.

security, email

wire-format §2.1.1

A TIFF file begins with an 8-byte header: 2-byte byte-order marker ('II'=0x4949 little-endian or 'MM'=0x4D4D big-endian), 2-byte magic value 42, and 4-byte offset to the first IFD.

email

wire-format §2.1.1

Each IFD field entry is exactly 12 bytes: 2-byte tag, 2-byte type, 4-byte count (number of values), and 4 bytes containing either the value itself or an offset to it stored outside the IFD.

email