From 7ca95b76e8df0c1650453a0a1828b6b592f465d6 Mon Sep 17 00:00:00 2001 From: Michiel Scholten Date: Fri, 3 Apr 2015 12:05:59 +0200 Subject: [PATCH] Extract to real datetime stamp from EXIF info and fix file modification time --- bin/fixpictimestamps | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 bin/fixpictimestamps diff --git a/bin/fixpictimestamps b/bin/fixpictimestamps new file mode 100755 index 0000000..3e1fe65 --- /dev/null +++ b/bin/fixpictimestamps @@ -0,0 +1,14 @@ +#!/bin/bash +find -name '*.jpg' | while read PIC; do +DATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ]//g') +echo "$DATE $PIC" +touch -t $(echo $DATE | sed 's/\(..$\)/\.\1/') $PIC +#mv -i $PIC $(dirname $PIC)/$DATE.jpg +done + +find -name '*.CR2' | while read PIC; do +DATE=$(exiftool -p '$DateTimeOriginal' $PIC | sed 's/[: ]//g') +echo "$DATE $PIC" +touch -t $(echo $DATE | sed 's/\(..$\)/\.\1/') $PIC +#mv -i $PIC $(dirname $PIC)/$DATE.jpg +done