aboutsummaryrefslogtreecommitdiffstats
path: root/src/libpyexiv2.cpp
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2007-01-20 21:48:08 +0100
committerOlivier Tilloy <olivier@tilloy.net>2007-01-20 21:48:08 +0100
commitcee5027a0d0881610a362d2ea1baee91d5489b1f (patch)
tree4f14d531ec485fe490848427e8f31c96ed4ff99c /src/libpyexiv2.cpp
parenta0492164d90727aa26f2a1849fb82697dda3d0ab (diff)
downloadpyexiv2-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.cpp24
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)