From 7329ffa21452841d5c5ef56d4f9ba150417f6f50 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 28 Aug 2022 11:44:07 +0200 Subject: Initial commit. --- dcimtimestamp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 dcimtimestamp (limited to 'dcimtimestamp') diff --git a/dcimtimestamp b/dcimtimestamp new file mode 100755 index 0000000..d67ab20 --- /dev/null +++ b/dcimtimestamp @@ -0,0 +1,22 @@ +#!/bin/sh + +if [ -z "$1" ]; then + echo "Set file modification time to EXIF timestamp" + echo "usage: $0 file1.jpg file2.jpg ..." + exit 0 +fi + +while [ ! -z "$1" ]; do + file="$1" + + if [ `basename "${file}" ".jpg"`".jpg" = "${file}" ]; then + + echo "settimg modification time for $file" + + # set file timestamp from exif data + exiftool "-DateTimeOriginal>FileModifyDate" "${file}" + fi + + shift +done + -- cgit v1.2.3