Media Exiftool
Context: $ARGUMENTS
ExifTool (by Phil Harvey) is the de facto standard for reading and writing metadata in images, RAW files, video, PDFs, and audio. It handles EXIF, IPTC, XMP, GPS, MakerNotes, QuickTime atoms, ID3, and hundreds of vendor-specific tags.
Quick start
- Dump everything grouped:
exiftool -g1 in.jpg→ Step 2, read - Machine-readable JSON:
exiftool -j in.jpg→ Step 2, read - Write a tag safely:
exiftool -P -overwrite_original -Artist="Alice" in.jpg→ Step 2, write - Nuke all metadata:
exiftool -all= -overwrite_original in.jpg→ Step 2, strip - Copy metadata src → dst:
exiftool -TagsFromFile src.jpg dst.jpg→ Step 2, copy - Shift dates +1h:
exiftool "-AllDates+=0:0:0 1:0:0" *.jpg→ Step 2, shift
When to use
- Auditing or editing EXIF/IPTC/XMP on JPEG, TIFF, HEIC, RAW, PNG, PDF
- Scrubbing GPS or all metadata before publishing photos
- Copying tags between a RAW and its JPEG sibling, or writing XMP sidecars
- Rewriting capture timestamps after a camera clock mishap
- Batch-renaming a folder by
DateTimeOriginal - Tagging IPTC keywords / XMP ratings for a DAM workflow
- Inspecting or editing QuickTime metadata in MOV/MP4 (including GoPro maker-notes)
Step 1 — Install
Pick one:
# macOS (Homebrew)
brew install exiftool
# Debian / Ubuntu
sudo apt install libimage-exiftool-perl
# Verify
exiftool -ver # expect 12.x or 13.x
ExifTool is a Perl script — perl must be present (it is on macOS and most Linux).
Step 2 — Pick an operation
| Op | When | Core command |
| ---------- | -------------------------------------------------- | --------------------------------------------------------------- |
| read | You need to see tags | exiftool -g1 in.jpg or exiftool -j in.jpg |
| write | You need to set or change one or more tags | exiftool -P -overwrite_original -Tag=Value in.jpg |
| strip | You need to remove metadata (e.g., before posting) | exiftool -all= -overwrite_original in.jpg |
| copy | You need to transfer tags from one file to another | exiftool -TagsFromFile src.jpg dst.jpg |
| shift | You need to correct camera clock drift | exiftool "-AllDates+=0:0:0 1:0:0" *.jpg |
| gps | You need to add/remove location | exiftool -GPSLatitude=... -GPSLongitude=... in.jpg |
| extract | You need the embedded thumbnail or preview | exiftool -b -ThumbnailImage in.jpg > thumb.jpg |
| sidecar | You need metadata beside (not inside) the file | exiftool -o dst.xmp -tagsFromFile src.jpg |
| rename | You need filenames derived from capture date | exiftool '-FileName<DateTimeOriginal' -d '%Y%m%d_%H%M%S.%%le' |
Step 3 — Run
Read
exiftool -g1 in.jpg # grouped by family-1 tag group
exiftool -j in.jpg # JSON (always a single-element array)
exiftool -s -s -s -CreateDate in.jpg # ultra-short: value only
exiftool -CreateDate -ImageWidth -ImageHeight in.jpg
exiftool -n in.jpg # numeric/raw values (no pretty formatting)
exiftool -t in.jpg # tab-separated
exiftool -r photos/ # recurse a directory
Write
# Single tag
exiftool -P -overwrite_original -Artist="Alice" in.jpg
# Multiple tags in one invocation (one pass is always faster)
exiftool -P -overwrite_original \
-Artist="Alice" \
-Copyright="(c) 2026 Alice" \
-XMP:Rating=5 \
in.jpg
# Append vs replace on list tags (IPTC keywords)
exiftool -P -overwrite_original -Keywords+="sunset" -Keywords+="beach" in.jpg # append
exiftool -P -overwrite_original -Keywords="sunset" in.jpg # replace
exiftool -P -overwrite_original -Keywords-="badtag" in.jpg # remove one
# Set group explicitly (tags with the same short name exist in EXIF, XMP, IPTC)
exiftool -P -overwrite_original -XMP:Creator="Alice" -IPTC:By-line="Alice" -EXIF:Artist="Alice" in.jpg
-P preserves the filesystem mtime (otherwise ExifTool updates it to "now"). -overwrite_original skips the default in.jpg_original backup — only use after you have verified the command works on a copy.
Strip
exiftool -all= -overwrite_original in.jpg # everything (DESTRUCTIVE)
exiftool -gps:all= -overwrite_original in.jpg # GPS group only
exiftool -exif:all= -overwrite_original in.jpg # EXIF only, keep XMP/IPTC
exiftool -all= -tagsfromfile @ -orientation in.jpg # strip all, restore orientation
Copy
exiftool -TagsFromFile src.jpg dst.jpg # all writable tags
exiftool -TagsFromFile src.jpg "-DateTimeOriginal" "-Make" "-Model" dst.jpg
exiftool -TagsFromFile src.jpg -all:all dst.jpg # every group
Shift dates
exiftool "-AllDates+=0:0:0 1:0:0" *.jpg # +1 hour
exiftool "-AllDates-=0:0:1 0:0:0" *.jpg # -1 day
exiftool "-AllDates+=0:0:0 0:30:0" -if '$make eq "Apple"' *.jpg
AllDates is a convenience shortcut for DateTimeOriginal + CreateDate + ModifyDate. Date format is YYYY:MM:DD HH:MM:SS (colons, not dashes).
GPS
exiftool -GPSLatitude=37.7749 -GPSLongitude=-122.4194 \
-GPSLatitudeRef=N -GPSLongitudeRef=W \
in.jpg
Write decimal latitude/longitude; the Ref tags (N/S for latitude, E/W for longitude) must be set too. ExifTool returns DMS on read unless you pass -n.
Extract thumbnail / preview
exiftool -b -ThumbnailImage in.jpg > thumb.jpg
exiftool -b -PreviewImage in.cr2 > preview.jpg
exiftool -b -JpgFromRaw in.nef > full.jpg
XMP sidecar
exiftool -o dst.xmp -tagsFromFile src.jpg # create sidecar from image
exiftool -tagsfromfile src.xmp dst.jpg # apply sidecar to image
Batch rename by capture date
exiftool '-FileName<DateTimeOriginal' -d '%Y%m%d_%H%M%S.%%le' *.jpg
# %%le = lowercase file extension; ExifTool interprets the outer %-codes, so double them.
Step 4 — Verify
Always read back after a write:
exiftool -G1 -a -s -Artist -Copyright -XMP:Rating in.jpg
For full roundtrip integrity: exiftool -validate -warning -a in.jpg.
Available scripts
scripts/exif.py— argparse wrapper over exiftool forread,write,strip,copy,shift-dates,gps,extract-thumbnail,batch-rename,sidecar. Supports--dry-runand--verbose. Stdlib only.
uv run ${CLAUDE_SKILL_DIR}/scripts/exif.py read --input in.jpg --json
uv run ${CLAUDE_SKILL_DIR}/scripts/exif.py write --input in.jpg --set "Artist=Alice" --set "Copyright=(c) 2026" --preserve-mtime
uv run ${CLAUDE_SKILL_DIR}/scripts/exif.py strip --input in.jpg --gps-only --preserve-mtime
uv run ${CLAUDE_SKILL_DIR}/scripts/exif.py shift-dates --input ./trip --delta "0:0:0 1:0:0"
uv run ${CLAUDE_SKILL_DIR}/scripts/exif.py batch-rename --dir ./trip --pattern DateTimeOriginal --format "%Y%m%d_%H%M%S.%%le"