Home > Uncategorized > fun with exiftool

fun with exiftool

exiftool is a very flexible little devil for manipulating image metadata.

Examples:

Simple: Extracting image metadata:
exiftool -s -FileName -MIMEType -ImageWidth -ImageHeight -CreateDate -T -d "%Y:%m:%d-%H:
%M:%S" *.jpg

More Involved: Correct dates by adding one year, but only for some of the files. In this case the criterion is the date to be in 2008.
far=( `exiftool -s -T -FileName -CreateDate . | grep 2008 | cut -f1` ); echo ${#far[@]}; for f in ${far[@]}; do exiftool '-AllDates+=1:0:0 0:0:0' $f; done
A more elegant way was suggested by Phil (see comment below), as in
exiftool -if ‘$createdate =~ /2008/’ ‘-AllDates+=1:0:0 0:0:0′ .

Advertisements
Categories: Uncategorized Tags: ,
  1. Phil Harvey
    27 March 2009 at 13:58

    No need to script the second example, it can all be done by exiftool:

    exiftool -if ‘$createdate =~ /2008/’ ‘-AllDates+=1:0:0 0:0:0′ .

  2. rouvas
    27 March 2009 at 14:52

    Very usefull clarification, Phil.

    I was actually looking for a way to do exactly the same thing with exiftool, but I finally gave up and used bash.

    Your way is definitely more elegant.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: