#!/bin/sh
#
# Set photo modification timestamp to time specified in EXIF
#
# $Id: exiftime,v 1.7 2012/07/07 00:24:47 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
