projects
/
blog.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
03437ae
)
Add NAME_BY_DATE_FIELD_NAME override to name-by-date.sh.
author
W. Trevor King
<wking@drexel.edu>
Sat, 10 Sep 2011 13:14:13 +0000
(09:14 -0400)
committer
W. Trevor King
<wking@drexel.edu>
Sat, 10 Sep 2011 13:14:13 +0000
(09:14 -0400)
posts/name-by-date/name-by-date.sh
patch
|
blob
|
history
diff --git
a/posts/name-by-date/name-by-date.sh
b/posts/name-by-date/name-by-date.sh
index abfbc4cabfd340a8ee649f440e20422fac2829ef..a4784bca7b8cef38d779f44f4286b3fdecd91987 100755
(executable)
--- 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)