diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2007-01-20 21:48:08 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2007-01-20 21:48:08 +0100 |
commit | cee5027a0d0881610a362d2ea1baee91d5489b1f (patch) | |
tree | 4f14d531ec485fe490848427e8f31c96ed4ff99c /src/libpyexiv2.cpp | |
parent | a0492164d90727aa26f2a1849fb82697dda3d0ab (diff) | |
download | pyexiv2-cee5027a0d0881610a362d2ea1baee91d5489b1f.tar.gz |
Added two methods to class Image, isExifTagSet() and isIptcTagSet(), to determine whether a tag is set.
Diffstat (limited to 'src/libpyexiv2.cpp')
-rw-r--r-- | src/libpyexiv2.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/libpyexiv2.cpp b/src/libpyexiv2.cpp index f77b6c7..6eebbdd 100644 --- a/src/libpyexiv2.cpp +++ b/src/libpyexiv2.cpp @@ -88,6 +88,18 @@ namespace LibPyExiv2 throw Exiv2::Error(METADATA_NOT_READ); } + bool Image::isExifTagSet(std::string key) + { + if(_dataRead) + { + Exiv2::ExifKey exifKey = Exiv2::ExifKey(key); + Exiv2::ExifMetadata::iterator i = _exifData.findKey(exifKey); + return (i != _exifData.end()); + } + else + throw Exiv2::Error(METADATA_NOT_READ); + } + boost::python::tuple Image::getExifTag(std::string key) { if(_dataRead) @@ -192,6 +204,18 @@ namespace LibPyExiv2 throw Exiv2::Error(METADATA_NOT_READ); } + bool Image::isIptcTagSet(std::string key) + { + if(_dataRead) + { + Exiv2::IptcKey iptcKey = Exiv2::IptcKey(key); + Exiv2::IptcMetadata::iterator i = _iptcData.findKey(iptcKey); + return (i != _iptcData.end()); + } + else + throw Exiv2::Error(METADATA_NOT_READ); + } + boost::python::tuple Image::getIptcTag(std::string key) { if(_dataRead) |