Commit 1834cea6 authored by Alexandre Rostovtsev's avatar Alexandre Rostovtsev Committed by Paolo Bacchilega
Browse files

Enable building with exiv2-0.21 (#349150)

Due to API changes in exiv2-0.21 (see

), gthumb with exiv2 support
enabled fails to compile. This patch updates gthumb to allow compilation
with both exiv2-0.20 and 0.21. Since ifd IDs are no longer part of the
public API, the patch uses group names instead (which works with
exiv2-0.20 as well, modulo the fact that 0.21 has isMakerGroup() instead
of isMakerIfd() in 0.20).
In addition, instead of numeric comparison with ids1Id (which wouldn't
work with exiv2-0.21 in any case), isMakerGroup()/isMakerIfd() are now
used to determine whether or not a tag is a MakerNote.
Signed-off-by: default avatarAlexandre Rostovtsev <>
parent f008d9f8
......@@ -497,19 +497,19 @@ set_attributes_from_tagsets (GFileInfo *info)
static const char *
get_exif_default_category (const Exiv2::Exifdatum &md)
#if EXIV2_TEST_VERSION(0, 21, 0)
if (Exiv2::ExifTags::isMakerGroup(md.groupName()))
if (Exiv2::ExifTags::isMakerIfd(md.ifdId()))
return "Exif::MakerNotes";
switch (md.ifdId()) {
case Exiv2::ifd1Id:
if (md.groupName().compare("Thumbnail") == 0)
return "Exif::Thumbnail";
case Exiv2::gpsIfdId:
else if (md.groupName().compare("GPSInfo") == 0)
return "Exif::GPS";
case Exiv2::iopIfdId:
else if (md.groupName().compare("Iop") == 0)
return "Exif::Versions";
return "Exif::Other";
......@@ -531,7 +531,11 @@ exiv2_read_metadata (Exiv2::Image::AutoPtr image,
stringstream description;
if (! md->tagLabel().empty())
description << md->tagLabel();
else if (md->ifdId () > Exiv2::ifd1Id)
#if EXIV2_TEST_VERSION(0, 21, 0)
else if (Exiv2::ExifTags::isMakerGroup(md->groupName()))
else if (Exiv2::ExifTags::isMakerIfd(md->ifdId()))
// Must be a MakerNote - include group name
description << md->groupName() << "." << md->tagName();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment