From 5e436f033421072c9a2da13f2193398db8a7e89d Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Thu, 4 Oct 2007 22:26:26 +0200 Subject: 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. --- src/pyexiv2.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') 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 -- cgit