aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-12-02 19:13:37 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-12-02 19:13:37 +0100
commit835bd643072b45b1c489f3b9d4e5a523578e4803 (patch)
tree8d4541880e0adab9839a79d8b80ac9fe80593b18 /src/exiv2wrapper.cpp
parentcd32cc006eb10ac846f33bf062ed6e6078cfbdcf (diff)
downloadpyexiv2-835bd643072b45b1c489f3b9d4e5a523578e4803.tar.gz
Fix build against libexiv2 0.21.
This latest release (2010-12-01) changed some public APIs, hence the need for conditional code.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 0d80e05..4004f20 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -523,6 +523,20 @@ ExifTag::ExifTag(const std::string& key, Exiv2::Exifdatum* datum, Exiv2::ExifDat
_data = 0;
}
+// Conditional code, exiv2 0.21 changed APIs we need
+// (see https://bugs.launchpad.net/pyexiv2/+bug/684177).
+#if EXIV2_TEST_VERSION(0,21,0)
+ Exiv2::ExifKey exifKey(key);
+ _type = Exiv2::TypeInfo::typeName(exifKey.defaultTypeId());
+ _name = exifKey.tagName();
+ _label = exifKey.tagLabel();
+ _description = exifKey.tagDesc();
+ _sectionName = Exiv2::ExifTags::sectionName(exifKey);
+ // The section description is not exposed in the API any longer
+ // (see http://dev.exiv2.org/issues/744). For want of anything better,
+ // fall back on the section’s name.
+ _sectionDescription = _sectionName;
+#else
const uint16_t tag = _datum->tag();
const Exiv2::IfdId ifd = _datum->ifdId();
_type = Exiv2::TypeInfo::typeName(Exiv2::ExifTags::tagType(tag, ifd));
@@ -531,6 +545,7 @@ ExifTag::ExifTag(const std::string& key, Exiv2::Exifdatum* datum, Exiv2::ExifDat
_description = Exiv2::ExifTags::tagDesc(tag, ifd);
_sectionName = Exiv2::ExifTags::sectionName(tag, ifd);
_sectionDescription = Exiv2::ExifTags::sectionDesc(tag, ifd);
+#endif
}
ExifTag::~ExifTag()