EXIF Data Loss in JPEG to AVIF Conversion
Converting legacy JPEG images to the modern AVIF format significantly improves compression efficiency, but the process introduces distinct risks of metadata degradation and loss. Because JPEG and AVIF handle metadata storage through fundamentally different container architectures, moving EXIF data between them often leads to broken offset pointers, truncated multi-segment blocks, stripping of proprietary camera data, and conflicting image transformation tags. Understanding where these pipeline failures occur is essential for preventing archival and technical data loss during image migration.
Structural Differences Between APP1 and ISOBMFF
JPEG stores metadata inside discrete segments bounded by markers,
with EXIF residing primarily inside APP1 markers limited to
64 kilobytes per segment. In contrast, AVIF relies on the ISO Base Media
File Format (ISOBMFF), which organizes all image data and metadata
inside a hierarchical system of "boxes" (such as meta,
iloc, and iinf).
When an encoder extracts an EXIF block from a JPEG's
APP1 marker, it must reconcile the JPEG-specific
header—usually an ASCII "Exif" string followed by two zero bytes
(Exif\0\0)—with the ISOBMFF specification. The ISOBMFF
standard requires a 4-byte offset indicating the start of the TIFF
header. Incompetent or naive converters often fail to strip the JPEG
prelude or write the incorrect 4-byte offset. As a result, subsequent
decoders cannot locate the TIFF header, causing the entire EXIF payload
to be treated as corrupt and discarded.
MakerNote Pointer Corruption
The most severe data degradation occurs within the EXIF
MakerNote tag (Tag ID 0x927c). Camera
manufacturers (such as Sony, Canon, and Nikon) write proprietary
hardware, lens, and shooting data inside this tag. Unlike standard EXIF
tags, MakerNote structures frequently rely on absolute byte
offsets calculated from the very beginning of the original JPEG file or
the start of the initial TIFF header.
When an AVIF converter extracts the EXIF payload:
- Padding bytes are often stripped or normalized.
- The starting offset changes relative to the new container.
- Endianness markers may be mishandled if the container parses and reconstructs the EXIF tree instead of copying the raw binary.
Once these byte positions shift, internal pointers within the
MakerNote point to invalid memory addresses. While the EXIF
block might technically exist inside the AVIF file, specialized tools
and raw processors can no longer parse the manufacturer-specific
parameters.
Multi-Segment and Extended Metadata Truncation
Because a single JPEG marker segment cannot exceed 65,535 bytes,
cameras and editing software split large metadata payloads across
multiple markers. For example, Extended XMP or large preview thumbnails
embedded within EXIF are distributed across sequential APP1
or APP2 markers.
Many standard JPEG-to-AVIF converters only read the primary
APP1 marker. During conversion, any secondary or chained
metadata segments are frequently dropped. This results in the complete
destruction of:
- Embedded non-standard camera calibration data.
- Full-resolution embedded JPEG preview thumbnails.
- Extended edit histories and rights-management schemas.
Orientation and Transformation Conflicts
Legacy JPEGs rely on the standard EXIF Orientation tag
(Tag ID 0x0112) to instruct decoders how to rotate or
mirror the image matrix for display. AVIF, however, natively handles
geometric transformations directly within the ISOBMFF container via the
Image Rotation (irot) and Image Mirror (imir)
boxes.
During conversion, two common failure states cause data and visual anomalies:
- Double Rotation: The encoder applies the rotation
to the AVIF bitstream and adds an
irotbox, but leaves the legacy EXIFOrientationtag unchanged. Decoders that read both formats apply the transform twice. - Metadata Stripping: The encoder strips the EXIF
Orientationtag to prevent playback errors, but in doing so, permanently destroys the historical record of the camera's original physical sensor orientation.
Color Profile and NCLX Discrepancies
JPEGs define color spaces using an embedded ICC profile inside
APP2 markers or via EXIF tags like ColorSpace.
AVIF prioritizes native container signaling via the colr
box using NCLX (Non-Constant Luminance) identifiers for color primaries,
transfer characteristics, and matrix coefficients.
If a conversion tool encounters a legacy EXIF tag defining an uncalibrated color profile or a legacy Adobe RGB space, it may map the pixel values to a standard sRGB NCLX box without preserving the embedded ICC profile. Once the ICC profile is stripped in favor of coarse NCLX parameters, wide-gamut data is permanently clipped, leading to visual fidelity loss that cannot be reversed.