Skip to main content

To simplify exif manipulations with python. Writing, reading, and more...

Project description

Build Status Windows Build Coverage Status docs

To simplify exif manipulations with Python. Writing, reading, and more… Piexif is pure Python. To everywhere with Python.

Document: http://piexif.readthedocs.org/en/latest/

Online demo: http://piexif-demo.appspot.com/demo

Install

‘easy_install’:

$ easy_install piexif

or ‘pip’:

$ pip install piexif

or download .zip, extract it. Put ‘piexif’ directory into your environment.

Why Choose Piexif

How to Use

There are only just five functions.

  • load(filename) - Get exif data as dict.

  • dump(exif_dict) - Get exif as bytes.

  • insert(exif_bytes, filename) - Insert exif into JPEG, or WebP.

  • remove(filename) - Remove exif from JPEG, or WebP.

  • transplant(filename, filename) - Transplant exif from JPEG to JPEG.

Example

exif_dict = piexif.load("foo1.jpg")
for ifd in ("0th", "Exif", "GPS", "1st"):
    for tag in exif_dict[ifd]:
        print(piexif.TAGS[ifd][tag]["name"], exif_dict[ifd][tag])

With PIL(Pillow)

from PIL import Image
import piexif

im = Image.open(filename)
exif_dict = piexif.load(im.info["exif"])
# process im and exif_dict...
w, h = im.size
exif_dict["0th"][piexif.ImageIFD.XResolution] = (w, 1)
exif_dict["0th"][piexif.ImageIFD.YResolution] = (h, 1)
exif_bytes = piexif.dump(exif_dict)
im.save(new_file, "jpeg", exif=exif_bytes)

Environment

Tested on Python 2.7, 3.3, 3.4, 3.5, 3.6 and pypy3. Piexif would run even on IronPython. Piexif is OS independent and can run on Google App Engine.

License

This software is released under the MIT license, see LICENSE.txt.

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

piexif-1.1.2.zip (1.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piexif-1.1.2-py2.py3-none-any.whl (21.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file piexif-1.1.2.zip.

File metadata

  • Download URL: piexif-1.1.2.zip
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.1

File hashes

Hashes for piexif-1.1.2.zip
Algorithm Hash digest
SHA256 60cd973f7b5a6d999c3bb60b784745c8d5345486ef62708ffdc5cc4a78e44636
MD5 048fb466200b90084c4a65450ccb14fd
BLAKE2b-256 9cb0b1f1cb7bd1074f29d74b7c8b6124b8944a3fa42327524b110295279e76aa

See more details on using hashes here.

File details

Details for the file piexif-1.1.2-py2.py3-none-any.whl.

File metadata

  • Download URL: piexif-1.1.2-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.18.1 setuptools/28.8.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/3.6.1

File hashes

Hashes for piexif-1.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 22e40356e4b4d5069787caa010ae77779c7cf8fc875ba43103ded2a2fc7b0c5f
MD5 38162e2c00ad376584732d7429c37b29
BLAKE2b-256 d94519726eac3f8ddedccff86de92fa6d16d90b0e9257df811b7331f0b91d966

See more details on using hashes here.

Supported by

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