Project

General

Profile

Actions

The Metadata in JPEG files » History » Revision 3

« Previous | Revision 3/36 (diff) | Next »
Tuan Nhu, 22 Jul 2013 11:13


The Metadata in JPEG files

This article shares my investigations about the metadata structure in JPEG files. It also introduces briefly the algorithm used in exiv2 to read and write Exif, IPTC, XMP data and image comments on the JPEG files.

Background

JPEG ISO standard is a commonly used method of lossy compression for digital photography. The name "JPEG" stands for Joint Photographic Experts Group, the name of the committee.

JPEG refers only to a class of compression algorithms, not to a specific file format. In order to produce files with embedded JPEG streams, a number of file format standards have been adapted or devised. Some of them are JPEG /JFIF, JPEG /SPIFF (Still Picture Interchange File Format), JPEG /CIFF, JPEG/Exif (Exchangeable image file format).

Among them, the most common types are JPEG/Exif and JPEG/JFIF.
  • JPEG/Exif is the most common image format used by digital cameras and other photographic image capture devices.
  • JPEG/JFIF is the most common format for storing and transmitting photographic images on the World Wide Web.

The metadata structure in JPEG

A JPEG file contains several segments; each segment contains different kinds of data, delimited by two-byte codes called markers. The markers are hexadecimal; they begin with 0xFF and end with a code (1 byte) indicating the kind of marker.

Some markers consist of just those two bytes; others are followed by two bytes indicating the length of marker-specific payload data that follows. The length includes the two bytes for the length, but not the two bytes for the marker.

Updated by Tuan Nhu over 8 years ago · 3 revisions