Skip to main content

ExifReader

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.

Installation

PyPi

The recommend process is into install exifreader from the PyPi package See the pip documentation for more info.

Compatibility

Exifreader is tested and officially supported on the following Python versions:

  • 3.5 Support will likely be removed in future releases
  • 3.6
  • 3.7
  • 3.8

Usage

Command line

Some examples:

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

EXIF.py --help

Python Script

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])

An 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'

Tag Descriptions

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.

Processing Options

These options can be used both in command line mode and within a script.

Faster Processing

Don't process makernotes tags, don't extract the thumbnail image (if any).

Pass the -q or --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.

Pass the -t TAG or --stop-tag TAG argument, or as

tags = exifread.process_file(f, stop_tag='TAG')

where TAG is a valid tag name, ex 'DateTimeOriginal'.

The two above options are useful to speed up processing of large numbers of files.

Strict Processing

Return an error on invalid tags instead of silently ignoring.

Pass the -s or --strict argument, or as::

    tags = exifread.process_file(f, strict=True)

Metadata

Release files for ExifReader 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ExifReader 0.1.1
File Size Uploaded
ExifReader-0.1.1.tar.gz 32.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ExifReader 0.1.1
File Interpreter ABI Platform
ExifReader-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.1 kB

Release files / ExifReader-0.1.1.tar.gz

Download URL ExifReader-0.1.1.tar.gz
Size 32.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1b496a2f815ace94944a3211042f00019a666826e1f432da89583f2daab41a65
BLAKE2b-256 checksum
How to use checksums
fecbad2a880188cebfb20504f7d4df1ae7fc54d15b5ade6bb0a824bb03f18009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release files / ExifReader-0.1.1-py3-none-any.whl

Download URL ExifReader-0.1.1-py3-none-any.whl
Size 37.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
07ea31f2990818912426da3cc56b2ea4a190bc837c9576586075077b3448a256
BLAKE2b-256 checksum
How to use checksums
9e1b872bf6499c8af6e7d86ec9822d9f6f18a298a39c46ca62c65110de6ecec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page