conflict between various library to process EXIF data


Bram Mertens


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
( the EXIF
header is altered in such a way that it is no longer possible to read
the EXIF header with
Furthermore imghdr does not even recognize it as a JPEG anymore.

Also the file command in Linux no longer recognizes the EXIF header:
$ file DSC02299.JPG
DSC02299.JPG: JPEG image data, EXIF standard 2.21
$ 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 to pyexiv2 because the first does not provide
a method to add a comment to the header. Considering the fact that appears to be no longer under active development I simply
replaced all my calls to 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


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

Latest member

Latest Threads