Need help dumping exif data in canon raw files

Discussion in 'Python' started by Nuff Nuff, Nov 5, 2009.

  1. Nuff Nuff

    Nuff Nuff Guest

    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
     
    Nuff Nuff, Nov 5, 2009
    #1
    1. Advertising

  2. Nuff Nuff

    Paul Rubin Guest

    Nuff Nuff <> writes:
    > 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.
     
    Paul Rubin, Nov 5, 2009
    #2
    1. Advertising

  3. Nuff Nuff

    dmoore Guest

    On Nov 5, 6:27 pm, Paul Rubin <http://> wrote:
    > Nuff Nuff <> writes:
    > > 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.


    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/
     
    dmoore, Nov 6, 2009
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BILL
    Replies:
    0
    Views:
    516
  2. Timur Ametov

    Canon CD SDK 7.3

    Timur Ametov, Apr 21, 2006, in forum: C Programming
    Replies:
    3
    Views:
    1,870
    Timur Ametov
    Apr 21, 2006
  3. Canon Laser Printer

    , Apr 1, 2008, in forum: Python
    Replies:
    0
    Views:
    267
  4. robin

    Canon mp160 drivers

    robin, Oct 12, 2008, in forum: Python
    Replies:
    0
    Views:
    338
    robin
    Oct 12, 2008
  5. Uli Kunkel

    canon camera java wrapper?

    Uli Kunkel, Oct 30, 2008, in forum: Java
    Replies:
    0
    Views:
    401
    Uli Kunkel
    Oct 30, 2008
Loading...

Share This Page