Anatomy of an ISO/IEC 23008-12 HEIF Container: Items, References & Properties
Reading the Three-Table HEIF Metadata Directory
Unlike JPEG markers that wrap a single scan stream, a HEIC container organizes assets using a relational entity graph inside the meta box. First, ItemInfoBox (iinf) defines each numbered item via infe records, recording its four-character type (hvc1, grid, Exif, mime) and whether bit 0 of its flags marks it hidden from ordinary gallery enumeration.
Second, ItemReferenceBox (iref) encodes typed directed edges from one item ID to another: thmb binds a compact preview to its master image, auxl binds depth or HDR gain maps to a master image, dimg connects a derived grid to source tiles, and cdsc links Exif or XMP metadata blocks to the picture they describe.
- Third, iprp pairs an indexed ItemPropertyContainerBox (ipco) with ItemPropertyAssociation (ipma) lists.
- Each ipma association carries an essential bit indicating whether decoders must understand that property.
- Our bounded DataView parser validates every box offset before WASM allocation and flags truncated containers.
Enforcing Codec Verification Beyond Generic mif1 Brands
A file whose ftyp major brand reads mif1 could contain HEVC slices, AV1 slices, or JPEG items. Our inspector examines infe item types and ipco codec configuration boxes (hvcC versus av1C) before dispatching to libheif-js, cleanly handing AV1 containers off to our dedicated AVIF workflow.