Skip to content
Tech News
← Back to articles

Appreciating Exif

read original get Exif Data Viewer → more articles
Why This Matters

Understanding Exif metadata is crucial for image processing and digital photography, as it influences how images are correctly oriented and interpreted across devices and platforms. Recognizing where and how Exif data is stored helps developers and consumers ensure proper image display and preservation, especially when metadata may be stripped or altered during editing or transfer.

Key Takeaways

I recently was writing some code to apply a mask to an image input. The mask had no Exif metadata, but the image did, so I had to adjust for the orientation of the image by reading it from Exif.

This isn’t hard with libraries, and I knew the gist of the problem: images can have Exif, Exif is optional, phones and cameras use it for orientation, and you need to account for that when processing pixels directly. But I did not have a clear mental model of how Exif actually is represented in files.

I was curious. I had questions:

Where exactly is that orientation value stored? When should I rotate pixels instead of preserving a tag? What else might be hiding in the metadata? When is it typically stripped?

So this is a little random walk guide to Exif.

What is Exif?

Exif is short for Exchangeable Image File Format. The current standard comes from CIPA, which lists it as “Exchangeable image file format for digital still cameras: Exif Version 3.1.”1 The Library of Congress has a good preservation-oriented summary, too. You’ll often see EXIF in all caps in camera docs, file-format chunk names, and old forum posts, but Exif seems to be the normal spelling in the standard itself.

It is a metadata format that came out of the digital camera world in 1995, back when the problem was something like: this camera produced a JPEG, but where do we put the timestamp, shutter speed, aperture, focal length, thumbnail, and the fact that the camera was sideways?

The answer was Exif.

Most people run into this data through images from phones and cameras. It is also closely related to TIFF, because the actual Exif payload is a TIFF-shaped data structure living inside another file. Newer formats can carry Exif too, but each format gives it a different house.2

... continue reading