跪拜 Guibai
← All articles
Frontend

Your "Original" Photo Can Leak Your Home Address: The EXIF Privacy Problem

By 小码哥_常 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

A shared "original" photo can give away a street address, a workplace interior, or a child's school, and platforms that recompress images don't always save you. For developers, image upload pipelines that don't strip metadata make every user a potential target, so sanitizing EXIF before storage is a cheap default.

Summary

Phone photos record shooting time, camera model, and GPS coordinates when location permission is on. Social platforms strip EXIF during compression, but email attachments, cloud links, and Telegram's original-send mode pass it through untouched. A photo of your living room uploaded to a resale listing can reveal a precise address to anyone who checks metadata.

Removal is manageable. ExifTool's `-all=` flag wipes all metadata, and `-gps:all=` removes just location while keeping shooting parameters. A Python Pillow script rebuilds the image from pixel data to drop metadata, and a browser-based tool like glazlo.com/remove-metadata processes the file locally so it never hits a server. The article also flags subtleties: PNG lacks EXIF but stores metadata in tEXt/iTXt chunks, WebP and HEIC embed EXIF, and an embedded thumbnail can preserve the original composition even after you crop the main image.

Takeaways
— EXIF in JPEG/TIFF records shooting time, camera model, aperture/shutter/ISO, GPS coordinates when location permission is on, orientation, and sometimes a thumbnail.
— Most social platforms strip EXIF during compression, but email attachments, cloud links, and Telegram original sends keep it.
— ExifTool removes all metadata with `exiftool -all= photo.jpg` and only GPS with `exiftool -gps:all= photo.jpg`.
— Pillow can strip metadata by creating a new image that copies only pixel data.
— glazlo.com/remove-metadata processes images locally in the browser so the file is never uploaded.
— PNG stores metadata in tEXt and iTXt chunks, so screenshots aren't fully safe; WebP and HEIC also support embedded EXIF.
— Some cameras embed a thumbnail in EXIF that preserves the pre-crop composition even after editing the main image.
— iOS share menu offers an "Exclude Location" option; Android support varies by manufacturer.
Conclusions

The gap between platform compression and "original" sends is where privacy leaks happen; users who assume social platforms protect them are exposed when a channel preserves metadata.

Handling the EXIF orientation flag before stripping metadata is a detail that separates a trustworthy tool from one that produces sideways images; it's a reminder that metadata cleanup isn't a trivial delete.

Embedded thumbnails are an easy-to-miss vector because cropping the main image doesn't alter the stored thumbnail, so even "cleaned" images can leak the original frame.

Concepts & terms
EXIF
Exchangeable Image File Format; a metadata block embedded in JPEG and TIFF files that records camera settings, timestamps, orientation, and sometimes GPS coordinates.
GPS coordinates
Latitude and longitude values stored in EXIF when the camera app has location permission, sufficient to map a photo to a specific address or building.
PNG tEXt/iTXt chunks
Metadata storage mechanisms in PNG images; they don't hold GPS but can carry software names, creation times, and other identifying information.
EXIF orientation flag
A tag that tells viewers how to rotate the image for correct display; some tools strip EXIF without rotating pixels, leaving the photo sideways.
From the discussion
Featured comments
szp2005

The Pillow part will lose orientation: it only copies pixels, and the Orientation tag is also gone, so images taken vertically on a phone are saved horizontally. Before copying, first do img = ImageOps.exif_transpose(img) to apply the rotation to the pixels, then copy. (AI-assisted writing)

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗