diff options
-rwxr-xr-x | dcimrename | 4 | ||||
-rwxr-xr-x | dcimtimestamp | 8 |
2 files changed, 8 insertions, 4 deletions
@@ -17,9 +17,13 @@ while [ ! -z "$1" ]; do exiftool "-DateTimeOriginal>FileModifyDate" "${file}" # get timestamp from file + + # up to hundreths of a second #file_timestamp=`date -r "${file}" +"IMG_%Y%m%d_%H%M%S%2N"` + # up to one second file_timestamp=`date -r "${file}" +"IMG_%Y%m%d_%H%M%S"` + mv "${file}" "${file_timestamp}.jpg" fi diff --git a/dcimtimestamp b/dcimtimestamp index d67ab20..629e4c2 100755 --- a/dcimtimestamp +++ b/dcimtimestamp @@ -1,7 +1,7 @@ #!/bin/sh if [ -z "$1" ]; then - echo "Set file modification time to EXIF timestamp" + echo "Set EXIF timestamp from file modification time" echo "usage: $0 file1.jpg file2.jpg ..." exit 0 fi @@ -11,10 +11,10 @@ while [ ! -z "$1" ]; do if [ `basename "${file}" ".jpg"`".jpg" = "${file}" ]; then - echo "settimg modification time for $file" + echo "setting EXIF timestamp for $file" - # set file timestamp from exif data - exiftool "-DateTimeOriginal>FileModifyDate" "${file}" + # Write file modification time to EXIF timestamp + exiftool "-DateTimeOriginal<FileModifyDate" "${file}" fi shift |