Menu

Why Image Compressors Strip Metadata — and How to Prevent It
📰

Why Image Compressors Strip Metadata — and How to Prevent It

DEV Community: tutorial·GeoImageTagger·15 days ago
#H1O1uLex
#devtotutorial#devto#dev#metadata#exif
Long article (761 words) — no AI summary yet.
Reading 0:00
15s threshold

If you have ever run images through a compression pipeline and discovered the EXIF data came out empty, the explanation is usually straightforward: the compressor never handled the metadata in the first place.

Image compression operates on pixel data. Metadata — EXIF, IPTC, XMP, GPS coordinates — is stored in structurally separate sections of the file. Whether those sections survive compression is entirely a function of how the tool is built.

How Metadata Is Stored (By Format)

JPEG

JPEG files use marker segments to organize data. The pixel stream starts at the SOS (Start of Scan) marker. Metadata lives in application markers:

APP1 ( 0xFFE1 ) — EXIF and XMP payloads

APP13 ( 0xFFED ) — IPTC-IIM data

APP2 ( 0xFFE2 ) — ICC color profiles

Low-level libraries like libjpeg and libjpeg-turbo process only the pixel buffer. They do not automatically parse or carry over APPn markers.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.