This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed. Find sources: "Interchange File Format" – news ·newspapers ·books ·scholar ·JSTOR(September 2020) (Learn how and when to remove this message) |
| Interchange File Format | |
|---|---|
| Internet media type | application/x-iff |
| Developed by | Electronic Arts,Commodore |
| Initial release | 1985; 41 years ago (1985) |
| Type of format | Digital container format |
Interchange File Format (IFF) is a genericdigital container file format originally introduced byElectronic Arts (in cooperation withCommodore) in 1985 to facilitate transfer of data between software produced by different companies.
IFF files do not have any standardfilename extension. On many systems that generate IFF files, file extensions are not important because theoperating system storesfile formatmetadata separately from thefile name. The.iff filename extension is commonly used for theILBMimage file format, which uses the IFF container format.
Resource Interchange File Format is a format developed byMicrosoft andIBM in 1991 that is based on IFF, except thebyte order has been changed tolittle-endian to match thex86microprocessor architecture.Apple'sAudio Interchange File Format (AIFF) is abig-endianaudio file format developed from IFF. TheTIFF image file format is not related to IFF.
An IFF file is built up fromchunks. Each chunk begins with what the specification calls a "Type ID" (what theMacintosh called anOSType, andWindows developers might call aFourCC). This is followed by a 32-bit signedinteger (all integers in IFF file structure arebig-endian) specifying the size of the following data (the chunk content) in bytes.[1] Because the specification includes explicit lengths for each chunk, it is possible for a parser to skip over chunks that it either can't or doesn't care to process.
This structure is closely related to thetype–length–value (TLV) representation.
There are predefinedgroup chunks, with type IDsFORM,LIST andCAT .[NB 1] AFORM chunk is like a record structure, containing a type ID (indicating the record type) followed by nested chunks specifying the record fields. ALIST is a factoring structure containing a series ofPROP (property) chunks plus nested group chunks to which those properties apply. ACAT is just a collection of nested chunks with no special semantics. Group chunks can contain other group chunks, depending on the needs of the application. Group chunks, like their simpler counterparts, contain a length element. Skipping over a group can thus be done with a simple relativeseek operation.
Chunks must begin on even file offsets, as befits the origins of IFF on the Motorola68000 processor, which couldn't address quantities larger than a byte on odd addresses. Thus chunks with odd lengths will be "padded" to an even byte boundary by adding a so-called "pad byte" after their regular end.
The top-level structure of an IFF file consists of exactly one of the group chunks:FORM,LIST orCAT , whereFORM is by far the most common one.
Each type of chunk typically has a different internal structure, which could be numerical data, text, or raw data. It is also possible to include other IFF files as if they are chunks (note that they have the same structure: four letters followed with length), and some formats use this. There are standard chunks that could be present in any IFF file, such asAUTH (containing text with information about author of the file),ANNO (containing text with annotation, usually name of the program that created the file),NAME (containing text with name of the work in the file),VERS (containing file version),(c) (containing text with copyright information). There are also chunks that are common among a number of formats, such asCMAP, which holds color palette inILBM,ANIM andDR2D files (pictures, animations and vector pictures). There are chunks that have a common name but hold different data such asBODY, which could store an image in anILBM file and sound in an8SVX file. And finally, there are chunks unique to their file type. Some programs that create IFF files add chunks to them with their internal data; these same files can later be read by other programs without any disruption (because their parsers could skip uninteresting chunks), which is a great advantage of IFF and similar formats.