From 557fd4fb1ae585f70922a008ef90f52b7e76fa6b Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 10 Sep 2011 09:14:13 -0400 Subject: [PATCH] Add NAME_BY_DATE_FIELD_NAME override to name-by-date.sh. --- posts/name-by-date/name-by-date.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/posts/name-by-date/name-by-date.sh b/posts/name-by-date/name-by-date.sh index abfbc4c..a4784bc 100755 --- a/posts/name-by-date/name-by-date.sh +++ b/posts/name-by-date/name-by-date.sh @@ -28,7 +28,10 @@ while [ -n "$1" ]; do FILE=$1 TYPE=$(file "$FILE" | grep JPEG) if [ -n "$TYPE" ]; then - FIELD_NAME='Date and Time' + FIELD_NAME="$NAME_BY_DATE_FIELD_NAME" + if [ -z "$FIELD_NAME" ]; then + FIELD_NAME='Date and Time' + fi ASCII_DATE=$(exif -m -t "$FIELD_NAME" "$FILE") # 2010:07:02 08:36:20 if [ $? -ne 0 ]; then # use similar field, e.g. 'Date and Time (original)' FIELD=$(exif -m "$FILE" | grep "$FIELD_NAME" | head -n1) -- 2.26.2