2024/02/05
That a *.tiff file:
- was specified in 1986 by a company later consumed by Adobe
- was originally intended for scanner interop
- starts with an 8-byte header that includes a 2-byte magic number, a 2-byte endianness flag, and a 4-byte pointer to the first Image File Directory entry
- the max tiff size is 2^32 bytes due to the u32 pointer size
- Each IFD starts with a u16 count of entries, then a sequence of 12-byte ields, then another 4-byte offset of the next IFD entry (0 = none)
- each IFD entry (= “field”) has a 2-byte tag, 2 bytes of field type, 4-byte count, and 4-byte offset of the value(s) of the field.
- values may occur pretty much anywhere in the file, even before the IFD
- each “subfile” may have one of several encodings (e.g. black/white, grayscale, rgb, etc)