Skip to content

Instantly share code, notes, and snippets.

@bef
Created December 10, 2020 14:23
Show Gist options
  • Save bef/96243bb8a8d7a5d3f629418630e25c89 to your computer and use it in GitHub Desktop.
Save bef/96243bb8a8d7a5d3f629418630e25c89 to your computer and use it in GitHub Desktop.
Luminar 4 better filename after export hack/workaround
#!/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