September 2018
Intermediate to advanced
426 pages
10h 46m
English
First, we imported the PIL image and PIL TAGS modules. PIL is an image-processing module in Python. It supports many file formats and has a powerful image-processing capability. Then we iterate through the results and print the values. There are many other modules that support EXIF data extraction, such as ExifRead. In this example, to acquire the EXIF data, we can use the _getexif() method.
You can find the following code in the get_exif_tags.py file in the exiftags folder:
from PIL import Imagefrom PIL.ExifTags import TAGSfor (i,j) in Image.open('images/image.jpg')._getexif().items(): print('%s = %s' % (TAGS.get(i), j))