September 2018
Intermediate to advanced
426 pages
10h 46m
English
To obtain the information of the EXIF tags of an image, the _getexif() method of the image object can be used. For example, we can have a function where, from the image path, we can return information from EXIF tags.
The following functions are available in the extractDataFromImages.py file in the exiftags folder:
def get_exif_metadata(image_path): exifData = {} image = Image.open(image_path) if hasattr(image, '_getexif'): exifinfo = image._getexif() if exifinfo is not None: for tag, value in exifinfo.items(): decoded = TAGS.get(tag, tag) exifData[decoded] = value decode_gps_info(exifData) return exifData
This information can be improved by decoding the information we have obtained in a latitude-longitude values ...