aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-11-20 18:35:10 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-11-20 18:35:10 +0100
commitf67e40873fb2078ee8a065e3210aff95251b8cd9 (patch)
tree5679010384af5e71bca631fec05bf7db4f462cdc
parent30c9eab71722eac240e2885b1b259cad96fd2df7 (diff)
downloadpyexiv2-f67e40873fb2078ee8a065e3210aff95251b8cd9.tar.gz
Make Image::getXmpTag return an XmpTag.
-rw-r--r--src/exiv2wrapper.cpp10
-rw-r--r--src/exiv2wrapper.hpp10
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);