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
@ -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
#------------------------------------------------ #------------------------------------------------