Skip to content
Latchkey

exiftool -all=: Strip Metadata From Files

exiftool -all= image.jpg deletes all metadata; add -overwrite_original to avoid the .jpg_original backup file.

Stripping EXIF/GPS/XMP from assets before they ship is a common CI privacy and reproducibility step. The gotcha is exiftool's default backup file, which surprises pipelines that count outputs.

What it does

-all= sets every writable tag to empty, removing metadata. By default exiftool renames the original to <file>_original and writes the stripped version in place; -overwrite_original skips the backup. You can also strip selectively, e.g. only GPS tags with -gps:all=.

Common usage

Terminal
# strip everything, keep a _original backup
exiftool -all= image.jpg
# strip everything, no backup file
exiftool -all= -overwrite_original image.jpg
# strip only GPS data
exiftool -gps:all= -overwrite_original image.jpg
# strip a whole tree in place
exiftool -all= -overwrite_original -r ./public/img

Options

FlagWhat it does
-all=Remove all writable metadata
-gps:all=Remove only GPS tags
-overwrite_originalEdit in place without a _original backup
-overwrite_original_in_placeOverwrite preserving file attributes/inode
-rRecurse into directories
-PPreserve the file modification date

In CI

Always add -overwrite_original in pipelines, or every processed file leaves a <name>_original sibling that pollutes artifacts and can double-count in later steps. To assert success, re-read with exiftool -j and check the metadata is gone.

Common errors in CI

"command not found" means install libimage-exiftool-perl. "Error: Writing of this type of file is not supported" means exiftool can read but not write metadata for that format (some video/raw types); it cannot strip those. "Nothing to do" means there was no removable metadata. Unexpected _original files in the artifact listing mean -overwrite_original was omitted.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →