Created
January 19, 2016 17:31
-
-
Save hagope/a2e1aebfd55350c14234 to your computer and use it in GitHub Desktop.
There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+
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
# There's a bug in the Android Camera that doesn't set Create Date and Date Time Original in the photo's EXIF meta data, but only when the images are NOT set to HDR+ | |
# The following is fix using exiftool (brew install exiftool) to set these fields | |
# Run these in the terminal in sequence | |
# First fix DateTimeOriginal | |
exiftool "-datetimeoriginal<filemodifydate" -r -if '(not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg | |
# Then fix CreateDate | |
exiftool "-createdate<datetimeoriginal" -r -if '(not $createdate or ($createdate eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' *.jpg | |
# Finally check that the EXIF fields have been set correctly | |
exiftool -T -filename -datetimeoriginal -createdate *.jpg -if '(not $createdate or ($createdate eq "0000:00:00 00:00:00") or not $datetimeoriginal or ($datetimeoriginal eq "0000:00:00 00:00:00")) and ($filetype eq "JPEG")' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thank you so much.