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.…