Created
October 8, 2018 21:30
-
-
Save Philmod/7e9212c37074e49ca44668d30e7d9311 to your computer and use it in GitHub Desktop.
Script to redate pictures using offset
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 | |
for f in DSC_*.*; do | |
ts="$(GetFileInfo -d "$f")" | |
e="$(date -j -f "%m/%d/%Y %H:%M:%S" "$ts" +%s)" | |
((o=304730220)) | |
((e+=o)) | |
nd="$(date -r $e "+%m/%d/%Y %H:%M:%S")" | |
echo "$nd" | |
SetFile -m "$nd" "$f" | |
SetFile -d "$nd" "$f" | |
exiftool "-AllDates<FILE:FileModifyDate" -overwrite_original $f | |
SetFile -m "$nd" "$f" | |
SetFile -d "$nd" "$f" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment