Changed KeyValue for Ipptc KeyTag from value to values for Keywords. Thank you Helge.Privat for the change.

svn: r16811
This commit is contained in:
Rob G. Healey 2011-03-12 05:10:30 +00:00
parent ba42df2706
commit 90616376ed

View File

@ -37,6 +37,7 @@ from fractions import Fraction
# Gtk/ Gramps modules # Gtk/ Gramps modules
#------------------------------------------------ #------------------------------------------------
import gtk import gtk
from gen.ggettext import gettext as _ from gen.ggettext import gettext as _
# import the pyexiv2 library classes for this addon # import the pyexiv2 library classes for this addon
@ -60,7 +61,7 @@ except ImportError:
if not pyexiv2_required: if not pyexiv2_required:
raise Exception(_("The minimum required version for pyexiv2 must be pyexiv2-%d.%d.%d\n" raise Exception(_("The minimum required version for pyexiv2 must be pyexiv2-%d.%d.%d\n"
"or greater. You may download it from here: %s\n\n") % ( "or greater. You may download it from here: %s\n\n") % (
REQ_pyexiv2_VERSION, _DOWNLOAD_LINK)) REQ_pyexiv2_VERSION, _DOWNLOAD_LINK))
# import the required classes for use in this gramplet # import the required classes for use in this gramplet
from pyexiv2 import ImageMetadata, Rational from pyexiv2 import ImageMetadata, Rational
@ -97,10 +98,14 @@ _DATAMAP = [ImageArtist, ImageCopyright, ImageDateTime,
_allmonths = list( [_dd.short_months[i], _dd.long_months[i], i] for i in range(1, 13) ) _allmonths = list( [_dd.short_months[i], _dd.long_months[i], i] for i in range(1, 13) )
"""
This addon/ gramplet will display an image's metadata if the python library,
pyexiv2-0.2.0 or greater, is installed? You may download it from:
http://tilloy.net/dev/pyexiv2/
"""
class MediaMetadata(Gramplet): class MediaMetadata(Gramplet):
"""
Displays the Media Metadata if present ?
"""
def init(self): def init(self):
self.exif_column_width = 15 self.exif_column_width = 15
@ -450,13 +455,13 @@ class MediaMetadata(Gramplet):
self.ValueType = None self.ValueType = None
if "Exif" in KeyTag: if "Exif" in KeyTag:
try: try:
KeyValue = self.plugin_image[KeyTag].value
self.ValueType = 0
except KeyError:
KeyValue = self.plugin_image[KeyTag].raw_value KeyValue = self.plugin_image[KeyTag].raw_value
self.ValueType = 1 self.ValueType = 1
except KeyError:
KeyValue = self.plugin_image[KeyTag].value
self.ValueType = 0
except ValueError: except ValueError:
KeyValue = "" KeyValue = ""
@ -466,7 +471,7 @@ class MediaMetadata(Gramplet):
# Iptc KeyTag # Iptc KeyTag
elif "Iptc" in KeyTag: elif "Iptc" in KeyTag:
try: try:
KeyValue = self.plugin_image[KeyTag].value KeyValue = self.plugin_image[KeyTag].values
except KeyError: except KeyError:
KeyValue = "[not set]" KeyValue = "[not set]"
@ -476,7 +481,6 @@ class MediaMetadata(Gramplet):
except AttributeError: except AttributeError:
KeyValue = "" KeyValue = ""
return KeyValue return KeyValue
#------------------------------------------------ #------------------------------------------------