libextractor
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libextractor] RE: libextractor_exiv2 weirdness with Canon raw cr2 files


From: David Lasker
Subject: [libextractor] RE: libextractor_exiv2 weirdness with Canon raw cr2 files
Date: Sun, 12 Apr 2009 10:47:37 -0700

Hi Christian

In my testing of exiv2extractor.cc when linking with the system libexiv2,
with the symbol SUPPRESS_WARNINGS undefined, I found exceptions were being
thrown, due to the names of some of the tags changing since 0.7. Here are
the changes required:

--- exiv2extractor.cc    2009-04-11 17:47:27.000000000 -0700
+++ exiv2extractor.cc    2009-04-12 10:35:09.000000000 -0700
@@ -189,7 +188,7 @@
         // Flash bias
         // Todo: Implement this for other cameras
         newResult = addExiv2Tag(exifData,
-                                "Exif.CanonCs2.FlashBias",
+                                "Exif.CanonSi.FlashBias",
                                 EXTRACTOR_FLASH_BIAS,
                                 result);
         if (newResult == result) {
@@ -273,7 +272,7 @@
         // Macro mode
         // Todo: Implement this for other cameras
         newResult = addExiv2Tag(exifData,
-                                "Exif.CanonCs1.Macro",
+                                "Exif.CanonCs.Macro",
                                 EXTRACTOR_MACRO_MODE,
                                 result);
         if (newResult == result) {
@@ -299,7 +298,7 @@
         // Image quality setting (compression)
         // Todo: Implement this for other cameras
         newResult = addExiv2Tag(exifData,
-                                "Exif.CanonCs1.Quality",
+                                "Exif.CanonCs.Quality",
                                 EXTRACTOR_IMAGE_QUALITY,
                                 result);
         if (newResult == result) {
@@ -369,7 +368,7 @@
         // Todo: Implement this for other cameras
 
         newResult = addExiv2Tag(exifData,
-                                "Exif.CanonCs2.WhiteBalance",
+                                "Exif.CanonSi.WhiteBalance",
                                 EXTRACTOR_WHITE_BALANCE,
                                 result);
         if (newResult == result) {

Thanks for the help!

Dave

-----Original Message-----
From: Christian Grothoff [mailto:address@hidden 
Sent: Saturday, April 11, 2009 7:46 PM
To: David Lasker
Cc: 'Nils Durner'; address@hidden; address@hidden
Subject: Re: libextractor_exiv2 weirdness with Canon raw cr2 files

Looks like exiv2 is much more stable / directly usable these days.  I've 
removed the old 0.7 code from our SVN and changed the build to link against 
libexiv2 from the system instead.  Still, passing --enable-exiv2 is required

(since I didn't write auto-detection configure magic yet).

Christian

On Saturday 11 April 2009 07:17:04 pm David Lasker wrote:
> Never mind, I see that libextractor uses a copy of the source files of an
> old version of libexiv2.
>
> I was able to implement what I wanted by taking a copy of
exiv2extractor.cc
> and linking it with the current version of the library.
>
> Any plans to refresh the exiv2 library version used by libextractor, or
> make it link with the real library on the build machine?
>
> Thanks for the help!
>
> Dave
>
> -----Original Message-----
> From: David Lasker [mailto:address@hidden
> Sent: Saturday, April 11, 2009 5:09 PM
> To: 'Nils Durner'; 'address@hidden'; 'address@hidden';
> 'address@hidden'
> Subject: libextractor_exiv2 weirdness with Canon raw cr2 files
>
> 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
> exiv2extractor.cc.
>
> 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
> happening.
>
> 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!
>
> Dave
> -----Original Message-----
> From: Nils Durner [mailto:address@hidden
> Sent: Friday, April 10, 2009 11:44 AM
> To: David Lasker
> Cc: address@hidden
> Subject: Re: [libextractor] duplicate "software" fields for
> image/x-canon-cr2
>
> Hi,
>
> > mimetype - image/tiff
>
> Newer versions of libextractor correctly identify CR2 files as
>     image/x-canon-cr2
>
> > 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
> way, yes.
>
>
> Thanks,
>
> Nils Durner







reply via email to

[Prev in Thread] Current Thread [Next in Thread]