Extracting metadata from images
In this section, we will review how to extract EXIF metadata from images with the PIL module. EXchangeable Image File Format (EXIF) is a specification that adds metadata to certain types of image formats. Typically, JPEG and TIFF images contain this type of metadata. EXIF tags usually contain camera details and settings used to capture an image but can also contain more interesting information such as author copyright and geolocation data.
Introduction to EXIF and the PIL module
One of the main modules that we find within Python for the processing and manipulation of images is the Python Imaging Library (PIL). The PIL module allows us to extract the metadata of images in EXIF format.
We can install it with the following command:
$ pip3 install Pillow
EXIF is a specification that indicates the rules that must be followed when we are going to save images and defines how to store metadata in image and audio files. This specification is applied...