Pillow (version 5.3.0) is an actively maintained fork of the Python Imaging Library and is an extensive module that can archive, display, and process image files. A full description of this module can be read at http://www.pillow.readthedocs.io. This library can be installed using pip as follows:
pip install pillow==5.3.0
PIL provides a function named _getexif(), which returns a dictionary of tags and their values. Tags are stored in their decimal format rather than hexadecimal. Interpreting 0x010F in big-endian corresponds to the decimal value 271 for the Make tag. Rather than doing this the hard way with struct, we can simply query whether a tag exists and, if it does, then process the value:
>>> from PIL import Image >>> image = Image.open('img_42.jpg') >>> exif = image._getexif() >>> if 271 in exif.keys(): ... print('Make:', exif[271]) ... Make: Nokia