diff options
-rw-r--r-- | src/exiv2wrapper.cpp | 10 | ||||
-rw-r--r-- | src/exiv2wrapper.hpp | 10 |
2 files changed, 5 insertions, 15 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index e2638b4..be12731 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -312,7 +312,7 @@ boost::python::list Image::xmpKeys() } } -boost::python::tuple Image::getXmpTag(std::string key) +const XmpTag Image::getXmpTag(std::string key) { if(!_dataRead) { @@ -326,13 +326,7 @@ boost::python::tuple Image::getXmpTag(std::string key) throw Exiv2::Error(KEY_NOT_FOUND, key); } - Exiv2::Xmpdatum xmpDatum = _xmpData[key]; - std::string sTagName = xmpKey.tagName(); - std::string sTagLabel = xmpKey.tagLabel(); - std::string sTagDesc(Exiv2::XmpProperties::propertyDesc(xmpKey)); - std::string sTagType(Exiv2::XmpProperties::propertyInfo(xmpKey)->xmpValueType_); - std::string sTagValue = xmpDatum.toString(); - return boost::python::make_tuple(key, sTagName, sTagLabel, sTagDesc, sTagType, sTagValue); + return XmpTag(key, &_xmpData[key]); } void Image::setXmpTagValue(std::string key, std::string value) diff --git a/src/exiv2wrapper.hpp b/src/exiv2wrapper.hpp index 0ebdf53..76e5021 100644 --- a/src/exiv2wrapper.hpp +++ b/src/exiv2wrapper.hpp @@ -180,13 +180,9 @@ public: boost::python::list xmpKeys(); - // key - // tagname - // taglabel - // tagdesc - // type - // tagvalue (list) - boost::python::tuple getXmpTag(std::string key); + // Return the required XMP tag. + // Throw an exception if the tag is not set. + const XmpTag getXmpTag(std::string key); void setXmpTagValue(std::string key, std::string value); |