Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exif manipulation library for python [closed]

Tags:

python

exif

I'm looking for good exif (Exchangeable image file format) manipulation library for python. I prefer flexibility (e.g., ability to retrieve providers' proprietary tags) than processing speed. What would you suggest?

like image 486
oo_olo_oo Avatar asked Apr 19 '09 13:04

oo_olo_oo


People also ask

Can we add our own EXIF parameter?

EXIF key-value pairs are called tags, and each tag can contain either a string or numeric value. There are dozens of tags in the current EXIF standard (version 2.32), and anyone — from smartphone and camera manufacturers to photographers — is free to add their own.


1 Answers

You might want to check out exif-py:

Python library to extract EXIF data from tiff and jpeg files. Very easy to use - $ ./EXIF.py image.jpg

or the Python Imaging Library (PIL):

The Python Imaging Library (PIL) adds image processing capabilities to your Python interpreter. This library supports many file formats, and provides powerful image processing and graphics capabilities.

There's also the aptly named pyexif: http://pyexif.sourceforge.net/

The pyexif python library and tools aims at extracting EXIF information from Jpeg and Tiff files which include it. This information is typically included in images created using digital imaging devices such as digital cameras, digital film scanners, etc.

However, it looks like pyexif hasn't been updated in quite while. They recommend if theirs isn't doing the trick to check out EXIF-py, so you should probably try that one first, as their sourceforge page seems to have some activity there lately, though not much. Finally, using PIL you could do this:

from PIL import Image from PIL.ExifTags import TAGS  def get_exif(fn):     ret = {}     i = Image.open(fn)     info = i._getexif()     for tag, value in info.items():         decoded = TAGS.get(tag, tag)         ret[decoded] = value     return ret 

Disclaimer:
I actually have no idea which is best, this is just what I was able to piece together with Google. :)

like image 167
Paolo Bergantino Avatar answered Nov 04 '22 03:11

Paolo Bergantino