diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-03-24 09:53:17 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-03-24 09:53:17 +0100 |
commit | 1a28d13266e2993c52ededd3cfda3aa708c4e7c3 (patch) | |
tree | 79acbeb3d401e6f5b1d1c013bf5c505c4dd61173 /src/exiv2wrapper.cpp | |
parent | e78316f24a60c79ace82f537e83eed2d0261ab2e (diff) | |
download | pyexiv2-1a28d13266e2993c52ededd3cfda3aa708c4e7c3.tar.gz |
Private setters for EXIF tags.
Diffstat (limited to 'src/exiv2wrapper.cpp')
-rw-r--r-- | src/exiv2wrapper.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
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) |