Created
December 10, 2020 14:23
-
-
Save bef/96243bb8a8d7a5d3f629418630e25c89 to your computer and use it in GitHub Desktop.
Luminar 4 better filename after export hack/workaround
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## 2020-12-10 - BeF | |
## rename image files from exif data the way I like them: including original filename and date | |
if [[ $# -eq 0 ]]; then | |
echo "$0 <file> ..." | |
exit 1 | |
fi | |
for fn in "$@"; do | |
if [[ "$fn" =~ [0-9]\ at\ [0-9] ]]; then | |
echo "$fn not changed." | |
continue | |
fi | |
basefn="${fn%.*}" | |
extfn="${fn##*.}" | |
datefn=$(exiftool -dateFormat '%Y-%m-%d at %H-%M-%S' -S -s -DateTimeOriginal "$fn") | |
newfn="$basefn - $datefn.$extfn" | |
echo "$fn --> $newfn" | |
mv "$fn" "$newfn" | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment