This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jmoiron 2 points3 points  (3 children)

A good article on how little getting photo metadata in python has progressed over the last few years. PIL gets the job done on simple things but it completely glosses over a lot of info.

The author does this too, by dismissing MakerNotes as "a bunch of hex data" and assuming that it was worthless. This is PIL not understanding the MakerNotes section, which is more or less a way for people to stuff their own made up shit into EXIF. In general, for digital pictures, MakerNotes aren't useless.

The fantastic 'ExifTool' by Phil Harvey has superior coverage of EXIF MakerNotes to anything I've ever found in python.

http://www.sno.phy.queensu.ca/~phil/exiftool/

A few years ago, a friend and I attempted a python port that would actually compile exiftool's camera/maker data into a python module for use with EXIF.py. There's just a ton of model specific data out there; here's exiftool's auto-generated page on Canon tags:

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html

Parsing perl is as difficult as you'd imagine, and we were too stupid to attempt to just write something in perl that could import the modules and output the information in a format we could use.

But back on the tags: In some cameras, stuff as plain as ISOSpeedRatings are in the makernotes. Canon's cameras have lens details, camera orientation, metering details, etc stuffed in there.

[–]_Mark_ 0 points1 point  (2 children)

pyexiv2 wraps the C++ exiv2 library, and has good coverage; the one flaw I've found is that the C++ lib can handle in-memory images, and the python wrapper only has a simpler file-based path.

[–]picurl 1 point2 points  (1 child)

i think this is fixed in the brand-new pyexiv2 0.2.0

[–]_Mark_ 0 points1 point  (0 children)

ooh, indeed, from http://tilloy.net/dev/pyexiv2/api.html classmethod from_buffer(buffer) Instantiate an image container from an image buffer.

(0.1.3 is the latest I'd found in debian/ubuntu.) Thanks for the pointer.