conflict between various library to process EXIF data

Discussion in 'Python' started by Bram Mertens, Oct 5, 2009.

  1. Bram Mertens

    Bram Mertens Guest

    Hi,

    I posted this to [Image-SIG] a while ago but did not got a reply so I
    assume it may not have been the appropriate list. If this is again
    not the right list please direct me to the proper list.

    How to read and write EXIF data from images has been discussed several
    times on the [Image-SIG] list before but I could not find a discussion
    on the problem I've run into when using multiple of these.

    In short: after adding a comment to the EXIF header using the
    setComment(...) and writeMetadata(...) methods of pyeviv2
    (http://tilloy.net/dev/pyexiv2/doc/release-0.1.2/pyexiv2.htm) the EXIF
    header is altered in such a way that it is no longer possible to read
    the EXIF header with EXIF.py.
    Furthermore imghdr does not even recognize it as a JPEG anymore.

    >>> import imghdr
    >>> type = imghdr.what('DSC02299.JPG')
    >>> print type

    jpeg
    >>> type = imghdr.what('20070623-171634-DSC-H5.jpg')
    >>> print type

    None

    Also the file command in Linux no longer recognizes the EXIF header:
    before:
    $ file DSC02299.JPG
    DSC02299.JPG: JPEG image data, EXIF standard 2.21
    after:
    $ file 20070623-171634-DSC-H5.jpg
    20070623-171634-DSC-H5.jpg: JPEG image data
    (Note: part of the processing done is to rename the image based on the
    date in the EXIF header)

    I switched from EXIF.py to pyexiv2 because the first does not provide
    a method to add a comment to the header. Considering the fact that
    EXIF.py appears to be no longer under active development I simply
    replaced all my calls to EXIF.py with calls to the relevant pyexeiv2
    methods. However imghdr is part of the standard library so the fact
    it will not recognize the image anymore makes me wonder if maybe
    pyexiv2 is doing something "wrong" that might cause other problems
    later on.

    Can anybody provide insight into this?

    Thanks in advance

    Bram
     
    Bram Mertens, Oct 5, 2009
    #1
    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. leo
    Replies:
    2
    Views:
    481
  2. Roel Schroeven

    Writing EXIF data

    Roel Schroeven, Sep 29, 2005, in forum: Python
    Replies:
    2
    Views:
    1,543
    Roel Schroeven
    Sep 30, 2005
  3. charles cashion

    css conflict (or html conflict)

    charles cashion, Feb 18, 2009, in forum: HTML
    Replies:
    2
    Views:
    821
    charles cashion
    Feb 18, 2009
  4. Max Lapshin
    Replies:
    0
    Views:
    144
    Max Lapshin
    Jan 8, 2007
  5. Benjohn Barnes

    exifr - Ruby EXIF reading library

    Benjohn Barnes, Feb 3, 2009, in forum: Ruby
    Replies:
    2
    Views:
    292
Loading...

Share This Page