Skip to main content

Read and modify image EXIF metadata using Python.

Project description

https://travis-ci.org/TNThieding/exif.svg?branch=master https://coveralls.io/repos/github/TNThieding/exif/badge.svg?branch=master Documentation Status

Read and modify image EXIF metadata using Python without any third-party software dependencies. For example, batch process image metadata using a Python script.

Quick Start

Open an image with EXIF metadata using the Python open built-in function. Ensure the binary mode flag is set. Pass this image file object into the exif.Image class:

>>> from exif import Image
>>> with open('grand_canyon.jpg', 'rb') as image_file:
...     my_image = Image(image_file)
...

Access EXIF metadata using Python attribute notation:

>>> my_image.gps_latitude
(36.0, 3.0, 11.08)
>>> my_image.model
'iPhone 7'
>>> my_image.model = "Python"

Write the image with modified EXIF metadata to an image file using open in binary write mode:

>>> with open('modified_image.jpg', 'wb') as new_image_file:
...     new_image_file.write(my_image.get_file())
...

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

exif-0.1.0.tar.gz (2.9 MB view hashes)

Uploaded Source

Built Distribution

exif-0.1.0-py2-none-any.whl (3.0 MB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page