Skip to content

Instantly share code, notes, and snippets.

@hagope
Created January 19, 2016 17:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hagope/a2e1aebfd55350c14234 to your computer and use it in GitHub Desktop.
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+
# 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")'
@andresPereira
Copy link

thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment