HOME/Articles/

pil example exif (snippet)

Article Outline

Python pil example 'exif'

Modules used in program:

  • import PIL.ExifTags
  • import PIL.Image

python exif

Python pil example: exif

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
}