Fixed a failure to save...

svn: r17713
This commit is contained in:
Rob G. Healey 2011-06-08 02:48:47 +00:00
parent ba55888eff
commit da6423d184

View File

@ -1239,35 +1239,23 @@ class EditExifMetadata(Gramplet):
sets the value for the metadata KeyTags sets the value for the metadata KeyTags
""" """
tagClass = KeyTag[0:5] tagClass = KeyTag[0:4]
if LesserVersion: if LesserVersion:
self.plugin_image[KeyTag] = KeyValue self.plugin_image[KeyTag] = KeyValue
else: else:
if tagClass == "Exif": try:
try: # tag is being modified... self.plugin_image.__setitem__(KeyTag, KeyValue)
self.plugin_image.__setitem__(KeyTag, KeyValue) except KeyError:
except KeyError: # tag is being created... if tagClass == "Exif":
self.plugin_image[KeyTag] = pyexiv2.ExifTag(KeyTag, KeyValue) self.plugin_image[KeyTag] = pyexiv2.ExifTag(KeyTag, KeyValue)
except (ValueError, AttributeError): # there is an error elif tagClass == "Xmp.":
pass # with either KeyTag or KeyValue is bad... self.plugin_image[KeyTag] = pyexiv2.XmpTag(KeyTag, KeyValue)
elif tagClass == "Iptc":
elif tagClass == "Xmp.": self.plugin_image[KeyTag] = IptcTag(KeyTag, KeyValue)
try: # tag is being modified... except (ValueError, AttributeError):
self.plugin_image.__setitem__(KeyTag, KeyValue) pass
except KeyError: # tag is being created...
self.plugin_image[KeyTag] = pyexiv2.XmpTag(KeyTag, KeyValue)
except (ValueError, AttributeError): # there is an error
pass # with either KeyTag or KeyValue is bad...
elif tagClass == "Uptc":
try: # tag is being modified...
self.plugin_image.__setitem__(KeyTag, KeyValue)
except KeyError: # tag is being created...
self.plugin_image[KeyTag] = pyexiv2.IptcTag(KeyTag, KeyValue)
except (ValueError, AttributeError): # there is an error
pass # with either KeyTag or KeyValue is bad...
def write_metadata(self, plugininstance): def write_metadata(self, plugininstance):
""" """