Skip to content

Instantly share code, notes, and snippets.

@yuliji
Created January 15, 2018 08:20
Show Gist options
  • Save yuliji/303f2aaf842f5b0c595862672eec7dc6 to your computer and use it in GitHub Desktop.
Save yuliji/303f2aaf842f5b0c595862672eec7dc6 to your computer and use it in GitHub Desktop.
[get exif] Python get exif of image
import PIL.Image
img = PIL.Image.open('img.jpg')
exif_data = img._getexif()
import PIL.ExifTags
exif = {
PIL.ExifTags.TAGS[k]: v
for k, v in img._getexif().items()
if k in PIL.ExifTags.TAGS
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment