duplicate "software" fields for image/x-canon-cr2

View: New views
8 Messages — Rating Filter:   Alert me  

duplicate "software" fields for image/x-canon-cr2

by David Lasker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am a libextractor newbie attempting to use it with Mediatomb and Canon RAW
(cr2) files.

I am using Ubuntu 8.04 with libextractor version v0.5.18a.

When I run the "extract" command on a typical cr2 file, I get the following:

> extract IMG_0986.CR2
software - 2009:01:23 13:14:20
software - Canon EOS DIGITAL REBEL XSi
size - 2256x1504
mimetype - image/tiff

Note that the "software" keyword is duplicated and includes both the
date/time and the camera model.

Unfortunately, Mediatomb doesn't handle the duplicate keyword very well. It
stores the camera model and ignores the date.

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?

Thanks for the help!

Dave





_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

Re: duplicate "software" fields for image/x-canon-cr2

by Nils Durner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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



_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

libextractor_exiv2 weirdness with Canon raw cr2 files

by David Lasker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:ndurner@...]
Sent: Friday, April 10, 2009 11:44 AM
To: David Lasker
Cc: libextractor@...
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




_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

RE: libextractor_exiv2 weirdness with Canon raw cr2 files

by David Lasker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:dave@...]
Sent: Saturday, April 11, 2009 5:09 PM
To: 'Nils Durner'; 'libextractor@...'; 'grothoff@...';
'ahuggel@...'
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:ndurner@...]
Sent: Friday, April 10, 2009 11:44 AM
To: David Lasker
Cc: libextractor@...
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




_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

Re: libextractor_exiv2 weirdness with Canon raw cr2 files

by Christian Grothoff-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:dave@...]
> Sent: Saturday, April 11, 2009 5:09 PM
> To: 'Nils Durner'; 'libextractor@...'; 'grothoff@...';
> 'ahuggel@...'
> 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:ndurner@...]
> Sent: Friday, April 10, 2009 11:44 AM
> To: David Lasker
> Cc: libextractor@...
> 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




_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

Re: libextractor_exiv2 weirdness with Canon raw cr2 files

by Nils Durner-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Dave,

is the data you get from libexiv2 enough or would it be better to read
additional information from the CR2 data structures[0]?
Especially, I'd like to have thumbnails extracted, maybe libraw[1] could
help here.

Best,

Nils


[0]   http://lclevy.free.fr/cr2/
       http://wildtramper.com/sw/cr2/cr2.html
[1]    http://www.libraw.org/


_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

RE: libextractor_exiv2 weirdness with Canon raw cr2 files

by David Lasker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I was just looking for exif keywords, so with Christian's change to
libextractor to link libexiv2 from the system, I have everything I want.

I would recommend against trying to parse the cr2 file yourself. This is a
never-ending quest, as Canon keeps tweaking the file format as new camera
models are introduced. It is better to leave this to specialty libraries
such as libraw.

Thanks for the help!

Dave

-----Original Message-----
From: Nils Durner [mailto:ndurner@...]
Sent: Sunday, April 12, 2009 4:09 AM
To: David Lasker
Cc: libextractor@...; ahuggel@...
Subject: Re: libextractor_exiv2 weirdness with Canon raw cr2 files

Hi Dave,

is the data you get from libexiv2 enough or would it be better to read
additional information from the CR2 data structures[0]?
Especially, I'd like to have thumbnails extracted, maybe libraw[1] could
help here.

Best,

Nils


[0]   http://lclevy.free.fr/cr2/
       http://wildtramper.com/sw/cr2/cr2.html
[1]    http://www.libraw.org/



_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor

RE: libextractor_exiv2 weirdness with Canon raw cr2 files

by David Lasker :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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:grothoff@...]
Sent: Saturday, April 11, 2009 7:46 PM
To: David Lasker
Cc: 'Nils Durner'; libextractor@...; ahuggel@...
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:dave@...]
> Sent: Saturday, April 11, 2009 5:09 PM
> To: 'Nils Durner'; 'libextractor@...'; 'grothoff@...';
> 'ahuggel@...'
> 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:ndurner@...]
> Sent: Friday, April 10, 2009 11:44 AM
> To: David Lasker
> Cc: libextractor@...
> 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





_______________________________________________
libextractor mailing list
libextractor@...
http://lists.gnu.org/mailman/listinfo/libextractor