aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2007-10-04 22:26:26 +0200
committerOlivier Tilloy <olivier@tilloy.net>2007-10-04 22:26:26 +0200
commit5e436f033421072c9a2da13f2193398db8a7e89d (patch)
tree5ebed7af14e914f9874bbdba42887256df3c2fc0 /src
parent1d1ad1b25af91d63ef9d2cd4df4925d9da9372f4 (diff)
downloadpyexiv2-5e436f033421072c9a2da13f2193398db8a7e89d.tar.gz
Implemented feature request tracked by bug #147534 (Provide access to interpreted data): added method interpretedExifValue(key) to class Image that returns the interpreted value of an EXIF tag as displayed by the exiv2 command-line tool.
Diffstat (limited to 'src')
-rw-r--r--src/pyexiv2.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 9cb19cf..6a1b46a 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -640,6 +640,23 @@ class Image(libpyexiv2.Image):
for key in self.iptcKeys():
self[key]
+ def interpretedExifValue(self, key):
+ """
+ Get the interpreted value of an EXIF tag as presented by the exiv2 tool.
+
+ For EXIF tags, the exiv2 command-line tool is capable of displaying
+ user-friendly interpreted values, such as 'top, left' for the
+ 'Exif.Image.Orientation' tag when it has value '1'. This method always
+ returns a string containing this interpreted value for a given tag.
+ Warning: calling this method will not cache the value in the internal
+ dictionary.
+
+ Keyword arguments:
+ key -- the EXIF key of the requested metadata tag
+ """
+ # This method was added as a requirement tracked by bug #147534
+ return self.__getExifTagToString(key)
+
def _test():
print 'testing library pyexiv2...'
# TODO: various tests