aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-03-19 09:45:16 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-03-19 09:45:16 +0100
commit7323c8131f036d0c8bcc2ffa4fc859e1d749ef22 (patch)
treeb00c06dc58c81994dc7cf8cdf10ea8bf935ab979 /src
parent2d7d156f764e0dff08893b91da009ddebc785661 (diff)
downloadpyexiv2-7323c8131f036d0c8bcc2ffa4fc859e1d749ef22.tar.gz
Generic getter for all tags.
Diffstat (limited to 'src')
-rw-r--r--src/exiv2wrapper.cpp1
-rw-r--r--src/pyexiv2.py11
2 files changed, 12 insertions, 0 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp
index 2aecf8d..3b1e229 100644
--- a/src/exiv2wrapper.cpp
+++ b/src/exiv2wrapper.cpp
@@ -456,6 +456,7 @@ void Image::setThumbnailFromJpegFile(const std::string path)
}
*/
+// TODO: update the errors code to reflect changes from src/error.cpp in libexiv2
void translateExiv2Error(Exiv2::Error const& error)
{
// Use the Python 'C' API to set up an exception object
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index c64471a..9360b60 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -1022,6 +1022,17 @@ class ImageMetadata(object):
self._tags['xmp'][key] = tag
return tag
+ def get(self, key):
+ """
+ Get a metadata tag for a given key.
+ DOCME
+ """
+ family = key.split('.')[0].lower()
+ try:
+ return getattr(self, '_get_%s_tag' % family)(key)
+ except AttributeError:
+ raise KeyError(key)
+
class Image(libexiv2python.Image):