From da6423d184d82c6c66f6b6d8903659da49c7055c Mon Sep 17 00:00:00 2001 From: "Rob G. Healey" Date: Wed, 8 Jun 2011 02:48:47 +0000 Subject: [PATCH] Fixed a failure to save... svn: r17713 --- src/plugins/gramplet/EditExifMetadata.py | 34 ++++++++---------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/src/plugins/gramplet/EditExifMetadata.py b/src/plugins/gramplet/EditExifMetadata.py index c03d78c38..3c0778638 100644 --- a/src/plugins/gramplet/EditExifMetadata.py +++ b/src/plugins/gramplet/EditExifMetadata.py @@ -1239,35 +1239,23 @@ class EditExifMetadata(Gramplet): sets the value for the metadata KeyTags """ - tagClass = KeyTag[0:5] + tagClass = KeyTag[0:4] if LesserVersion: self.plugin_image[KeyTag] = KeyValue else: - if tagClass == "Exif": - try: # tag is being modified... - self.plugin_image.__setitem__(KeyTag, KeyValue) - except KeyError: # tag is being created... + try: + self.plugin_image.__setitem__(KeyTag, KeyValue) + except KeyError: + if tagClass == "Exif": self.plugin_image[KeyTag] = pyexiv2.ExifTag(KeyTag, KeyValue) - except (ValueError, AttributeError): # there is an error - pass # with either KeyTag or KeyValue is bad... - - elif tagClass == "Xmp.": - try: # tag is being modified... - self.plugin_image.__setitem__(KeyTag, KeyValue) - 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... + elif tagClass == "Xmp.": + self.plugin_image[KeyTag] = pyexiv2.XmpTag(KeyTag, KeyValue) + elif tagClass == "Iptc": + self.plugin_image[KeyTag] = IptcTag(KeyTag, KeyValue) + except (ValueError, AttributeError): + pass def write_metadata(self, plugininstance): """