Skip to main content

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

Project description

Build Status Coverage Status docs

This is a renamed project from Pyxif. 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/

Install

‘easy_install’:

$ easy_install piexif

or ‘pip’:

$ pip install piexif

or download .zip, extract it and run:

$ python setup.py install

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, pypy, and pypy3. Piexif would run even on IronPython. Piexif is OS independent and can run on GoogleAppEngine.

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.0.0.zip (652.4 kB view details)

Uploaded Source

Built Distribution

piexif-1.0.0-py2.py3-none-any.whl (15.6 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file piexif-1.0.0.zip.

File metadata

  • Download URL: piexif-1.0.0.zip
  • Upload date:
  • Size: 652.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for piexif-1.0.0.zip
Algorithm Hash digest
SHA256 225cc951836205c7ad7dfeed45566d9b98fa045ae11f774cceaa88618e4311f6
MD5 644c7f84f15b0f7787836d19fae1fd35
BLAKE2b-256 92ccde237d9029dcace39a363df243f48506665c41462ec161e51d4d4673faf9

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for piexif-1.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cc7f7ffc3ba0c0ffde184bc4ba65833e54497a72ed996302c5f285200ca4e2ef
MD5 c6fe3c1d63801d5a2d274c1253970ab4
BLAKE2b-256 0990f7a933effbdc1489bcf12a0f9086f69ceb825ad75408b25f67d0cf17ba87

See more details on using hashes here.

Provenance

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