aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-11-25 10:17:41 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-11-25 10:17:41 +0100
commit5c289e01509bf5657377bfcdb9621853c66dd615 (patch)
treed529418df8488ef6cd6905d084085fa55703ea72 /src
parent1605f1f7d9ebe60313a3f4e33ce4133a6b72f2be (diff)
downloadpyexiv2-5c289e01509bf5657377bfcdb9621853c66dd615.tar.gz
Handle XMP tags for which static property information is not available.
Diffstat (limited to 'src')
-rw-r--r--src/exiv2wrapper.cpp21
-rw-r--r--src/pyexiv2/xmp.py2
2 files changed, 19 insertions, 4 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 96e9536..1b9dd8d 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -634,11 +634,24 @@ XmpTag::XmpTag(const std::string& key, Exiv2::Xmpdatum* datum): _key(key)
_datum = new Exiv2::Xmpdatum(_key);
}
- _title = Exiv2::XmpProperties::propertyTitle(_key);
- _description = Exiv2::XmpProperties::propertyDesc(_key);
+ const char* title = Exiv2::XmpProperties::propertyTitle(_key);
+ if (title != 0)
+ {
+ _title = title;
+ }
+
+ const char* description = Exiv2::XmpProperties::propertyDesc(_key);
+ if (description != 0)
+ {
+ _description = description;
+ }
+
const Exiv2::XmpPropertyInfo* info = Exiv2::XmpProperties::propertyInfo(_key);
- _name = info->name_;
- _type = info->xmpValueType_;
+ if (info != 0)
+ {
+ _name = info->name_;
+ _type = info->xmpValueType_;
+ }
}
/*void XmpTag::setRawValue(const std::string& value)
diff --git a/src/pyexiv2/xmp.py b/src/pyexiv2/xmp.py
index dc493d7..f63e0fb 100644
--- a/src/pyexiv2/xmp.py
+++ b/src/pyexiv2/xmp.py
@@ -125,6 +125,8 @@ class XmpTag(object):
self._value = value
elif self.type.lower().startswith('closed choice of'):
self._value = self._convert_to_python(value, self.type[17:])
+ elif self.type == '':
+ self._value = value
else:
self._value = self._convert_to_python(value, self.type)