Fixed a failure to save...
svn: r17713
This commit is contained in:
parent
ba55888eff
commit
da6423d184
@ -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:
|
||||||
|
try:
|
||||||
|
self.plugin_image.__setitem__(KeyTag, KeyValue)
|
||||||
|
except KeyError:
|
||||||
if tagClass == "Exif":
|
if tagClass == "Exif":
|
||||||
try: # tag is being modified...
|
|
||||||
self.plugin_image.__setitem__(KeyTag, KeyValue)
|
|
||||||
except KeyError: # tag is being created...
|
|
||||||
self.plugin_image[KeyTag] = pyexiv2.ExifTag(KeyTag, KeyValue)
|
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.":
|
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)
|
self.plugin_image[KeyTag] = pyexiv2.XmpTag(KeyTag, KeyValue)
|
||||||
except (ValueError, AttributeError): # there is an error
|
elif tagClass == "Iptc":
|
||||||
pass # with either KeyTag or KeyValue is bad...
|
self.plugin_image[KeyTag] = IptcTag(KeyTag, KeyValue)
|
||||||
|
except (ValueError, AttributeError):
|
||||||
elif tagClass == "Uptc":
|
pass
|
||||||
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):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user