Read Exif metadata from tiff and jpeg files.
Fork of Exif.py from ianare and used under BSD License
Easy to use Python module to extract Exif metadata from tiff and jpeg files.
Originally written by Gene Cash & Thierry Bousch.
Exifreader is tested and officially supported on the following Python versions:
- 3.5 Support will likely be removed in future releases
EXIF.py image1.jpg EXIF.py image1.jpg image2.tiff find ~/Pictures -name "*.jpg" -name "*.heic" -name "*.tiff" | xargs EXIF.py
Show command line options
import exifreader # Open image file for reading (binary mode) f = open(path_name, 'rb') # Return Exif tags tags = exifread.process_file(f)
Returned tags will be a dictionary mapping names of Exif tags to their values in the file named by path_name. You can process the tags as you wish. In particular, you can iterate through all the tags with
for tag in tags.keys(): if tag not in ('JPEGThumbnail', 'TIFFThumbnail', 'Filename', 'EXIF MakerNote'): print "Key: %s, value %s" % (tag, tags[tag])
if statement is used to avoid printing out a few of the tags that tend to be long or boring.
The tags dictionary will include keys for all of the usual Exif tags, and will also include keys for Makernotes used by some cameras, for which we have a good specification.
Note that the dictionary keys are the IFD name followed by the tag name. For example:: 'EXIF DateTimeOriginal', 'Image Orientation', 'MakerNote FocusMode'
Tags are divided into these main categories:
Image: information related to the main image (IFD0 of the Exif data).
Thumbnail: information related to the thumbnail image, if present (IFD1 of the Exif data).
EXIF: Exif information (sub-IFD).
GPS: GPS information (sub-IFD).
Interoperability: Interoperability information (sub-IFD).
MakerNote: Manufacturer specific information. There are no official published references for these tags.
These options can be used both in command line mode and within a script.
Don't process makernotes tags, don't extract the thumbnail image (if any).
--quick command line arguments, or as
tags = exifread.process_file(f, details=False)
Stop at a Given Tag
To stop processing the file after a specified tag is retrieved.
-t TAG or
--stop-tag TAG argument, or as
tags = exifread.process_file(f, stop_tag='TAG')
TAG is a valid tag name, ex
The two above options are useful to speed up processing of large numbers of files.
Return an error on invalid tags instead of silently ignoring.
--strict argument, or as::
tags = exifread.process_file(f, strict=True)
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for ExifReader-0.1.1-py3-none-any.whl