From 1a28d13266e2993c52ededd3cfda3aa708c4e7c3 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Tue, 24 Mar 2009 09:53:17 +0100 Subject: Private setters for EXIF tags. --- src/exiv2wrapper.cpp | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'src/exiv2wrapper.cpp') diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 8d22e69..83a3c95 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -123,36 +123,27 @@ boost::python::tuple Image::getExifTag(std::string key) } } -/* -boost::python::tuple Image::setExifTag(std::string key, std::string value) +void Image::setExifTag(std::string key, std::string value) { - boost::python::tuple returnValue; if(_dataRead) { Exiv2::ExifKey exifKey = Exiv2::ExifKey(key); Exiv2::ExifMetadata::iterator i = _exifData.findKey(exifKey); if(i != _exifData.end()) { - Exiv2::Exifdatum exifDatum = _exifData[key]; - returnValue = boost::python::make_tuple(std::string(exifDatum.typeName()), exifDatum.toString()); - // First erase the existing tag: in some case (and - // I don't know why), the new value won't replace - // the old one if not previously erased... + // First erase the existing tag: in some case (and I don't know + // why), the new value won't replace the old one if not previously + // erased... + // TODO: check if this is still valid with libexiv2 0.18 _exifData.erase(i); } - else - { - // The key was not found - returnValue = boost::python::make_tuple(std::string(""), std::string("")); - } _exifData[key] = value; - return returnValue; } else throw Exiv2::Error(METADATA_NOT_READ); } -boost::python::tuple Image::deleteExifTag(std::string key) +/*boost::python::tuple Image::deleteExifTag(std::string key) { boost::python::tuple returnValue; if(_dataRead) -- cgit