I started down the path of writing my own plugin for Canon CR2 files. I got
as far as writing the shell of a plugin that parses the file using libexiv2,
and prints an enumeration of all keywords found to the console. I am able to
invoke this plugin from the "extract" command, using the -l
<my_library_name> option, with no problems.
Then, I noticed libextractor_exiv2; I hadn't seen that plugin before. It
looks like it should be doing exactly what I want. But for some reason it
doesn't work on cr2 files. I rebuilt exiv2extractor.cc with
SUPPRESS_WARNINGS undefined, and I can see that it is catching an exception
'The memory contains data of an unknown image type' on line 433 of
My own test plugin shell parses the same cr2 file using the same code
Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(data, size);
that appears on line 103 of exiv2extractor.cc. In my code, no exception is
thrown and I am able to access the cr2 file's exif data.
I can see that libextractor_exiv2 is working correctly with jpeg files, but
I don't understand why it is failing with cr2 files.
At first I thought libextractor might be using an old version of libexiv2
that doesn't support cr2 files, but I don't see any evidence of that
All of these tests are done with the latest tar file libextractor-0.5.22,
using the libexiv2 version 0.16 that is bundled with Ubuntu 8.04.
Can anyone explain what is going on?
Thanks for the help!
From: Nils Durner [mailto:ndurner@goog...]
Sent: Friday, April 10, 2009 11:44 AM
To: David Lasker
Cc: libextractor@gnu.... Subject: Re: [libextractor] duplicate "software" fields for
> mimetype - image/tiff
Newer versions of libextractor correctly identify CR2 files as
> I am a programmer, and I was considering developing my own libextractor
> plug-in for cr2 files using libexiv2 to solve this problem. Before going
> down that path, can you suggest an easier way?
CR2 is not really TIFF, so writing a special plugin would be the right