Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Interchange File Format
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Structure== An IFF file is built up from [[Chunk (information)|chunk]]s. Each chunk begins with what the specification calls a "Type ID" (what the [[Macintosh]] called an [[OSType]], and [[Windows]] developers might call a [[FourCC]]). This is followed by a 32-bit signed [[integer]] (all integers in IFF file structure are [[big-endian]]) specifying the size of the following data (the chunk content) in bytes.<ref>{{cite web|last1=Reddy|first1=Martin|title='EA IFF 85' Standard for Interchange Format Files|url=http://www.martinreddy.net/gfx/2d/IFF.txt|website=martinreddy.net|access-date=8 April 2015|date=14 January 1985}}</ref> 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 the [[type–length–value]] (TLV) representation. There are predefined ''group'' chunks, with type IDs <code>FORM</code>, <code>LIST</code> and <code>CAT </code>.<ref group='NB'>With a trailing [[Space (punctuation)|space]] ([[ASCII]] 20h).</ref> A <code>FORM</code> chunk is like a record structure, containing a type ID (indicating the record type) followed by nested chunks specifying the record fields. A <code>LIST</code> is a factoring structure containing a series of <code>PROP</code> (property) chunks plus nested group chunks to which those properties apply. A <code>CAT </code> 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 relative [[fseek|seek operation]]. Chunks must begin on even file offsets, as befits the origins of IFF on the Motorola [[68000]] 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: <code>FORM</code>, <code>LIST</code> or <code>CAT </code>, where <code>FORM</code> 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 as <code>AUTH</code> (containing text with information about author of the file), <code>ANNO</code> (containing text with annotation, usually name of the program that created the file), <code>NAME</code> (containing text with name of the work in the file), <code>VERS</code> (containing file version), <code>(c) </code> (containing text with copyright information). There are also chunks that are common among a number of formats, such as <code>CMAP</code>, which holds color palette in [[ILBM]], [[ANIM]] and [https://wiki.amigaos.net/wiki/DR2D_IFF_2-D_Objects DR2D] files (pictures, animations and vector pictures). There are chunks that have a common name but hold different data such as <code>BODY</code>, which could store an image in an [[ILBM]] file and sound in an [[8SVX]] 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.
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Interchange File Format
(section)
Add topic