Tagging Photos with ExifTool

Background

There are three common formats for picture metadata:

  • IPTC ( International Press Telecommunications Council)
  • XMP ( Adobe's Extensible Metadata Platform ) - formatting for IPTC
  • EXIF ( xchangeable Image File Format for JPEG photos)

Tools

Exiftool

Scripts

Convert RAW to JPEG

#!/bin/sh

for RAW_FILE in `ls -1v --color=never *.CR2`; do
    JPG_FILE=${RAW_FILE%%.CR2}.JPG
    if [[ ! -f JPG/$JPG_FILE ]]; then
        echo Extracting preview from $RAW_FILE to $JPG_FILE with EXIF
        /usr/bin/exiftool -b -PreviewImage -w JPG/%f.JPG $RAW_FILE
        /usr/bin/exiftool -tagsfromfile $RAW_FILE --PreviewImage --ThumbnailImage -overwrite_original_in_place -q JPG/$JPG_FILE
        touch -r $RAW_FILE JPG/$JPG_FILE
    fi
done

soruce

Change date

Add 1 hour to all files in MY_PICTURE_FOLDER where date greated than 2/4/2006 source

exiftool -alldates+=1 -if '$CreateDate ge "2006:04:02"' MY_PICTURE_FOLDER

 Remove all metdata from files

exiftool -all= *.jpg

Adding a keyword

exiftool -Keywords+=london ./TEST.JPG