Exiftool commands

From OpenMedia
Jump to: navigation, search

Exiftool is a powerful tool to read and write metadata from/to images. It not only supports EXIF, but also IPTC, XMP and other metadata containers.

Exiftool is rather complicated to use, with 100s of command line options, here we collect some solutions we have previously used.

  • Retrieve metadata as xml: One file per image: exiftool -X -w xml C:\test or write to console: exiftool -X C:\test
  • Write a copyright notice to all files: exiftool -CopyrightNotice="© Creators & XYZ.org; Lizenz: Creative Commons cc-by-sa 3.0 Deutschland (http://creativecommons.org/licenses/by-sa/3.0/de/)" -E -overwrite_original_in_place C:\test\*.jpg
    • "-E" allows to use html-entity encoding (default EXIF is UTF8, but default IPTC is LATIN/ANSI!)
    • "-overwrite_original_in_place" prevents creation of original-file backups (rather copy folder for testing...)
  • Write tag value only IF NOT YET PRESENT: exiftool -comment-= -comment='new comment' a.jpg. MAYBE HAVE A BLANK AFTER "-="!
    • Examples for creators: exiftool -By-Line-= -By-Line="X. Bürr & A. Baar" -E -overwrite_original_in_place C:\test\*.jpg
    • Examples for combined: exiftool -By-Line="X & Y" -CopyrightNotice="© Creators; Lizenz: Creative Commons cc-by-sa 3.0 (http://creativecommons.org/licenses/by-sa/3.0/de/) or later" -keywords="XXXX" -credit="XXX AUTHOR XXX" -E -overwrite_original_in_place C:\test\*.jpg


Note: to add exif-data to a batch of files, Irfanview, thumbsmode, Ctrl-A = select all, Ctrl-I = Jpg lossless write IPTC may be simpler.