- WaSQL Wired
- Posts
- EXIF - The Metadata of Modern Photography
EXIF - The Metadata of Modern Photography
A deep dive into the hidden data tucked inside every image
Introduction
EXIF (Exchangeable Image File Format) is a standard that specifies the formats for images, sound, and ancillary tags used by digital cameras, smartphones, and other image and audio capturing devices. EXIF data embeds critical metadata within files, providing information about how, when, and with what equipment an image or audio file was created.
History of EXIF
EXIF was developed by the Japan Electronic Industries Development Association (JEIDA) and was first introduced in 1995 specifically for digital photography. The standard was created to address the growing need to store metadata along with digital photos as consumer digital cameras became more widespread.
The standard is now maintained by the Camera & Imaging Products Association (CIPA - https://www.cipa.jp/e/index.html
File Formats Supporting EXIF
EXIF metadata is primarily used in these file formats:
JPEG/JPG - The most common format that supports EXIF data
TIFF - Tagged Image File Format, which includes full EXIF support
HEIF/HEIC - Apple's High-Efficiency Image Format supports EXIF
RAW formats - Camera-specific raw formats like NEF (Nikon), CR2/CR3 (Canon), ARW (Sony)
WAV - Some audio files can contain EXIF data
PNG - Limited EXIF support through unofficial extensions
Notably, formats like GIF, BMP, and most video formats do not natively support EXIF metadata.
EXIF Data Structure
EXIF data is stored in a metadata section within the file structure using a TIFF-based format. When examining a raw image file in a hex editor, EXIF data would appear as binary data that isn't directly human-readable without proper parsing. The EXIF data begins with a marker segment (typically 0xFF, 0xE1 in JPEG files). This is followed by a length field indicating the size of the EXIF data. Next comes an identifier string "Exif" followed by two null bytes.The actual EXIF data then follows in a TIFF format structure with:
A TIFF header (containing byte order and offset to the first IFD)
Image File Directories (IFDs) containing multiple tags
Each tag has an ID, data type, count, and value or offset to value
So what is stored in EXIF? The most common metadata stored in EXIF includes:
Camera information: Camera make, model, serial number
Technical settings: Aperture, shutter speed, ISO, focal length, lens used
Date and time: When the photo was taken
Location data: GPS coordinates (latitude, longitude, altitude)
Copyright information: Owner and usage rights
Image parameters: Color space, white balance, etc.
Thumbnail image: Small preview version of the full image
While operating systems generally don't directly use EXIF data themselves as a core functionality, they do integrate with it in several ways through their file management systems and associated applications:
Thumbnail generation - Operating systems use EXIF thumbnails (if available) to display image previews in file explorers without having to process the entire image
File sorting and organization - OS file managers can read EXIF date/time information to sort images chronologically
File property displays - When you view file properties or details in Windows Explorer, macOS Finder, or Linux file managers, they extract and display relevant EXIF metadata
Photo library applications - Built-in OS photo applications (Photos on macOS, Photos app on Windows) use EXIF data to organize, sort, and display information about images
Rotation handling - Operating systems often check EXIF orientation tags to properly display images in the correct orientation
Geolocation features - If EXIF contains GPS coordinates, OS mapping applications can use this data to place photos on maps
Search indexing - Modern OS search functionality may index EXIF metadata to allow users to search for images based on camera model, date taken, or other EXIF properties
Unlike specialized photo editing software that might directly manipulate EXIF data, operating systems primarily read this data to enhance file management, organization, and viewing experiences.
If you want to view EXIF data yourself there are several ways to do so.
Windows: Right-click image > Properties > Details tab
macOS: Open in Preview > Tools > Show Inspector
Linux: Use tools like
exiftool
or image viewers like GIMP
There are also several command-line tools that allow you to see EXIF Data
exiftool
: The most powerful and versatile EXIF manipulation tool. https://exiftool.org/jhead
: JPEG header manipulation tool. https://github.com/Matthias-Wandel/jheadexiv2
: EXIF/IPTC metadata manipulation utility. https://github.com/Exiv2/exiv2
Example using ExifTool:
# View all EXIF data
exiftool image.jpg
# Remove all EXIF data
exiftool -all= image.jpg
# Add copyright information
exiftool -copyright="© 2024 Your Name" image.jpg
# Change date taken
exiftool "-DateTimeOriginal=2024:04:25 15:30:00" image.jpg
EXIF also allows you to add custom metadata through several mechanisms:
UserComment Tag (0x9286)
Specifically designed for user-defined content
Stores text information in a flexible format
Example:
exiftool -UserComment="LastViewer:username123" image.jpg
MakerNote Tag (0x927C)
Originally intended for camera manufacturers to store proprietary data
Can be repurposed for custom applications
More complex to implement but offers greater flexibility
Example:
exiftool -MakerNotes:CustomData="LastViewedBy:user" image.jpg
XMP (Extensible Metadata Platform)
XML-based standard that can be embedded within EXIF
Allows for more structured and complex metadata schemas
Better cross-application compatibility for custom fields
Example:
exiftool -XMP:LastViewer="username123" image.jpg
There are many reasons you may want to add custom EXIF data to media, including:
Asset tracking: Recording ownership, usage rights, or internal ID numbers
Workflow management: Tracking editing stages or approval status
User interaction: Storing view counts, ratings, or last user to modify
Custom camera settings: Recording specific shooting conditions not covered by standard tags
Application-specific data: Storing editing parameters or software-specific metadata
NOTE: EXIF data can inadvertently expose sensitive information such as location, owner details, timestamps, etc so it is best practice to Strip EXIF data before sharing photos publicly. You may also want to disable GPS tagging in camera settings for sensitive photos.
Conclusion
EXIF metadata serves as a critical but often invisible component of digital images, providing valuable context and information for users, applications, and services. Understanding how to access, manipulate, and leverage this data opens up numerous possibilities for photography workflows, software development, and digital asset management, while being mindful of privacy implications ensures responsible use of this powerful metadata standard.