changeset 1442:e37cde2857c1

fixed XMP and IPTC entry names in exif pane
author nadvornik
date Sun, 15 Mar 2009 12:41:39 +0000
parents 2908c28eb593
children f879e7d94c6d
files src/exiv2.cc
diffstat 1 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/exiv2.cc	Sun Mar 15 12:20:14 2009 +0000
+++ b/src/exiv2.cc	Sun Mar 15 12:41:39 2009 +0000
@@ -797,12 +797,27 @@
 {
 	try {
 		Exiv2::ExifKey ekey(key);
-		return utf8_validate_or_convert(Exiv2::ExifTags::tagLabel(ekey.tag(), ekey.ifdId ()));
+		return utf8_validate_or_convert(ekey.tagLabel().c_str());
 	}
 	catch (Exiv2::AnyError& e) {
-		std::cout << "Caught Exiv2 exception '" << e << "'\n";
-		return NULL;
+		try {
+			Exiv2::IptcKey ikey(key);
+			return utf8_validate_or_convert(ikey.tagLabel().c_str());
+		}
+		catch (Exiv2::AnyError& e) {
+			try {
+#if EXIV2_TEST_VERSION(0,16,0)
+				Exiv2::XmpKey xkey(key);
+				return utf8_validate_or_convert(xkey.tagLabel().c_str());
+#endif
+			}
+			catch (Exiv2::AnyError& e) {
+				std::cout << "Caught Exiv2 exception '" << e << "'\n";
+				return NULL;
+			}
+		}
 	}
+	return NULL;
 }
 
 static const AltKey *find_alt_key(const gchar *xmp_key)