#!/bin/sh
#
# Set photo modification timestamp to time specified in EXIF
#
# $Id: exiftime,v 1.5 2011/01/08 23:33:04 grog Exp $
#
# Set this to echo for testing
ECHO=
for i in $*; do
  CREATE_DATE=`exiftool $i | grep 'Date/Time Original' | head -1`
  DATE=`echo $CREATE_DATE | sed s'/.* : //; s/://g; s/ .*//`
  TIME=`echo $CREATE_DATE | sed s'/.* //; s/://; s/:/./`
  if [ "$DATE" != "" ]; then 
    echo $DATE$TIME $i | by 5 touch -t
  fi
done

