[Shotwell] [OT] How to find the EXIF thumbnail from the RAW images
jim at yorba.org
Thu Jul 8 10:44:54 PDT 2010
I'm cc:ing the gexiv2 mailing list, as this question pertains to both
First, a clarification. libexif is used because of a single limitation in
Exiv2 (the library gexiv2 wraps): Exiv2 doesn't offer a way to return the
raw (i.e. actual) bytes of the EXIF segment, which we checksum to identify
matching photos on a camera (where checksumming the entire file would be
expensive). libexif will do that, however. Additionally, libexif can
return the EXIF block without the thumbnail, the EXIF thumbnail alone, or
both, which is useful to Shotwell as well. If Exiv2 ever includes this
feature, Shotwell will probably jettison libexif entirely.
gexiv2 has two methods for retrieving the EXIF thumbnail. One is to call
gexiv2_metadata_get_exif_thumbnail() (which I assume you're doing). This
does pretty much what it sounds like it does.
However, some RAW formats don't include a thumbnail in their EXIF segment.
(Since the total size of an EXIF block can not be larger than 64K, it puts a
crimp on the size of the thumbnail.) RAW files often include large
thumbnails (some the dimensions of the RAW image itself), and often include
more than one. What you probably want to use is gexiv2's preview manager
gexiv2_metadata_get_preview_properties() lists all the previews found in the
file (including the EXIF thumbnail), and gexiv2_metadata_get_preview_image()
will return the thumbnail itself. Note that the list of returned properties
is ordered from smallest to largest.
More information on the preview manager is here:
On Thu, Jul 8, 2010 at 3:17 AM, Kushal Das <kushaldas at gmail.com> wrote:
> This may an OT question here, but I was reading and trying to using
> gexiv2. What I understood that you are using both gexiv2 and libexif
> in shotwell. When I tried only gexiv2 to extract thumbnails from RAW
> files (here .NEF) it failed. Do I have to use libexif as done in
> shotwell ?
> Shotwell mailing list
> Shotwell at lists.yorba.org
More information about the Shotwell