AVIF Orientation: Resolving EXIF vs ISOBMFF Conflicts

The AV1 Image File Format (AVIF) supports image orientation through two distinct mechanisms: native ISOBMFF transformation properties and legacy EXIF metadata. When these two sources provide conflicting rotational or mirroring instructions, decoders rely on strict conflict-resolution algorithms defined by the Multi-Image Application Format (MIAF) and AVIF specifications. These algorithms prioritize structural ISOBMFF container properties over embedded EXIF metadata, preventing rendering errors such as double-rotation while ensuring consistent presentation across diverse platforms.

The Dual-Metadata Architecture

AVIF is built on the ISO Base Media File Format (ISOBMFF). Within this structure, orientation can be defined at the container level using two specific transformative item properties stored in the Item Properties Box (ipco):

Concurrently, AVIF files frequently carry legacy EXIF payloads embedded within an Exif item. Inside this payload, the TIFF Orientation tag (Tag ID 0x0112) indicates rotation and flipping instructions using standard values from 1 to 8. Because both the ISOBMFF boxes and the EXIF payload operate independently, inconsistencies arise when editing tools update one source without synchronizing the other.

The Conflict-Resolution Order of Precedence

MIAF (ISO/IEC 23000-22), which forms the architectural baseline for AVIF, mandates a deterministic resolution path when both metadata types exist:

  1. ISOBMFF Inspection: The decoder scans the Item Reference Box (iref) and Item Properties Box (ipco / ipma) to detect whether irot or imir properties are associated with the primary image item.
  2. Container Precedence: If either irot or imir is present, the parser applies these transformations directly to the decoded pixel canvas. The rendering engine marks spatial transformation as fully resolved.
  3. EXIF Suppression: Once ISOBMFF transformation properties are applied, the decoder deliberately ignores the EXIF Orientation tag for rendering purposes. This suppression prevents "double-rotation," a failure state where both transformations are applied sequentially.
  4. EXIF Fallback: If the primary image item contains neither an irot nor an imir property, the decoder searches for an associated EXIF payload. If the EXIF block contains a valid orientation tag, the decoder applies that orientation to the reconstructed image.

Encoder-Side Normalization Strategies

To eliminate reliance on client-side resolution logic, conforming AVIF encoders employ specific sanitization strategies during file generation:

Parser Deviations and Legacy Behaviors

While modern web browsers adhere strictly to the MIAF precedence rules (ISOBMFF over EXIF), implementation variances still exist in third-party tooling: