aboutsummaryrefslogtreecommitdiffstats
path: root/src/exiv2wrapper.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2008-06-14 21:10:39 +0200
committerOlivier Tilloy <olivier@tilloy.net>2008-06-14 21:10:39 +0200
commite01497fc943963a82c7c84ef94798e6e43027198 (patch)
treeaf147e82452b19f252a92ad9a40503e196958969 /src/exiv2wrapper.cpp
parent3a5641e021ec3b6314de359d72dea83ad906f7ea (diff)
downloadpyexiv2-e01497fc943963a82c7c84ef94798e6e43027198.tar.gz
First basic support for XMP metadata: listing XMP keys.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r--src/exiv2wrapper.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index a0a69d5..3797b99 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -59,6 +59,7 @@ void Image::readMetadata()
_image->readMetadata();
_exifData = _image->exifData();
_iptcData = _image->iptcData();
+ _xmpData = _image->xmpData();
_dataRead = true;
}
@@ -68,6 +69,7 @@ void Image::readMetadata()
{
_image->setExifData(_exifData);
_image->setIptcData(_iptcData);
+ _image->setXmpData(_xmpData);
_image->writeMetadata();
}
else
@@ -322,9 +324,28 @@ boost::python::tuple Image::deleteIptcTag(std::string key, unsigned int index=0)
}
else
throw Exiv2::Error(METADATA_NOT_READ);
+}*/
+
+boost::python::list Image::xmpKeys()
+{
+ boost::python::list keys;
+ if(_dataRead)
+ {
+ for(Exiv2::XmpMetadata::iterator i = _xmpData.begin();
+ i != _xmpData.end();
+ ++i)
+ {
+ keys.append(i->key());
+ }
+ return keys;
+ }
+ else
+ {
+ throw Exiv2::Error(METADATA_NOT_READ);
+ }
}
-boost::python::tuple Image::tagDetails(std::string key)
+/*boost::python::tuple Image::tagDetails(std::string key)
{
std::string keyFamily = key.substr(0, 4);
if (keyFamily == "Exif")