brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: exiftool -TagsFromFile copies metadata from one photo to another

Metadata
~/tips/tip-exiftool-tagsfromfile

exiftool -TagsFromFile original.jpg -all:all edited.jpg

Restore the date, camera and GPS tags of a photo from the original file.

Edited and exported photos often lose their metadata, and then the date, camera and location are gone. exiftool can copy them back from the original.

Point it at the original and then at the edited file:

exiftool -TagsFromFile original.jpg -all:all edited.jpg
exiftool -TagsFromFile original.jpg -GPS:all edited.jpg

The first command copies every tag it can. The second copies only the GPS group, which is handy when you want the location back but nothing else. The same trick works to copy the date and camera info to a scan or to a converted file.

A caveat: exiftool keeps a backup next to the file called edited.jpg_original. Add -overwrite_original when you do not want that. Not every tag fits every format, and a tag that the target does not support is skipped with a warning instead of an error, so read the output once.

One more detail: you can list single tags instead of a whole group, such as -DateTimeOriginal -Model, when you only want those two values back. Test on a copy of the photo first when it matters.

Further reading: exiftool, -tagsFromFile, exiftool tag names

More Metadata tips exiftool -csv -FileName -Model -LensModel -ISO -r photos/ > photos.csv All Metadata tips (2) All topics

Link