changeset 11:d45ad0c070de

Change renaming of photos to use EXIF tool and metadata for dates
author IBBoard <dev@ibboard.co.uk>
date Wed, 31 Aug 2016 17:20:43 +0100
parents 4158847b0f18
children 3adc69ceb249
files rename-photos
diffstat 1 files changed, 2 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/rename-photos	Wed Aug 31 17:20:08 2016 +0100
+++ b/rename-photos	Wed Aug 31 17:20:43 2016 +0100
@@ -1,9 +1,4 @@
 #! /bin/bash
 
-DATE_PREFIX=$(date +Y%Y_%m)
-
-rename SAM_ ${DATE_PREFIX}_SAM_ SAM_*.JPG
-rename DSC ${DATE_PREFIX}_DSC DSC*.JPG
-rename IMG_ ${DATE_PREFIX}_IMG_ IMG_*_*.JPG
-rename PANO_ ${DATE_PREFIX}_PANO_ PANO_*_*.JPG
-rename JPG jpg ${DATE_PREFIX}*.JPG
+exiftool "-FileName<CreateDate" -d "Y%Y_%m_%d_%%f.%%e" DSC_*.JPG SAM_*.JPG IMG_*_*.JPG PANO_*_*.JPG
+rename JPG jpg *.JPG