Last active
November 20, 2022 12:29
-
-
Save d4kine/3c10a89e77fa9d7b8f8110f0b0ae8aa9 to your computer and use it in GitHub Desktop.
EXIF dates minus one hour and preserve original modify date (tested on MacOSX only)
This file contains hidden or 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 | |
FILE_LIST=$(find . -type f -iname "*.jpg" -o -iname "*.jpeg" -o -iname "*.raw" -o -iname "*.arw" | sort) | |
if [[ "${#FILE_LIST[@]}" == 0 ]]; then | |
echo "No files of found with type: (*.jpg|*.jpeg|*.raw|*.arw)" | |
exit 1 | |
fi | |
for f in $FILE_LIST; do | |
echo "PROCESSING $f" | |
ORIGIN_DATE=$(stat -f %SB -t %Y-%m-%dT%H:%M:%S $f) | |
exiftool -AllDates-="0:0:0 1:0:0" $f | |
touch -d "$ORIGIN_DATE" $f | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment