Need help dumping exif data in canon raw files

N

Nuff Nuff

So I've looked at all sorts of things, gone through as many different
things as I can find, but I fear python just can't do it.

I just need to be able to extract the exif info from a canon CR2
file. The info from canon suggest that it's just the same as a tiff,
but anytime I try to get PIL to open one, it says that it tastes
bad. And canon don't seem to be all that forthcoming on the details.

Ideally I'd be able to update the file with new exif info too, but
that would just be a bonus.

Right now I just want to open a file (say /home/nuffi/IMG_0001.CR2 or
d:\pic\IMG_0001.CR2) and print out all the exif info attached to the
file.

Is it impossible in Python?

TIA!

Nuffi
 
P

Paul Rubin

Nuff Nuff said:
I just need to be able to extract the exif info from a canon CR2
file. The info from canon suggest that it's just the same as a tiff,
but anytime I try to get PIL to open one, it says that it tastes
bad. And canon don't seem to be all that forthcoming on the details.

CR2 is a hardware-specific raw format and PIL should not be expected
to understand it. Try a websearch for dcraw.c to find a decoder for it.
 
D

dmoore

CR2 is a hardware-specific raw format and PIL should not be expected
to understand it. Try a websearch for dcraw.c to find a decoder for it.

also check out pyexiv2 (a python binding of exiv2), available in many
linux distros:

http://tilloy.net/dev/pyexiv2/index.htm

the current version of pyexiv2 doesn't yet support XMP metadata (the
underlying exiv2 lib does) but should be able to read Exif and IPTC
data ok. Looking at http://dev.exiv2.org/wiki/exiv2/Supported_image_formats
you may be SOL for writing to CR2. You can also try calling exiftool
from your python script: http://www.sno.phy.queensu.ca/~phil/exiftool/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top