When working with images in web applications, we usually focus on the visible content: dimensions, compression, and pixel data.
But a JPEG file can also contain hidden metadata, including camera settings, GPS coordinates, editing software information, and content provenance records.
The interesting part is that you don't need a backend to examine some of this information.
Modern browsers provide everything needed to read local files and inspect their binary structure.
Let's build a simple JPEG metadata segment inspector using vanilla JavaScript.
1. How JPEG Stores Metadata
A JPEG file contains multiple segments identified by marker bytes.
Some important markers include:
APP1 (0xFFE1): Commonly contains EXIF or XMP metadata.
APP13 (0xFFED): Can contain Photoshop resources and IPTC information.
APP11 (0xFFEB): Can contain JUMBF structures used for C2PA Content Credentials.
SOS (0xFFDA): Marks the beginning of scan data.
These markers provide a starting point for understanding information stored…