Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __setitem__(self,key,value):
try:
pyexiv2.ImageMetadata.__setitem__(self,key,value)
except TypeError:
if key.startswith('Exif'):
value=pyexiv2.ExifTag(key,value)
elif key.startswith('Iptc'):
value=pyexiv2.IptcTag(key,value)
elif key.startswith('Xmp'):
value=pyexiv2.XmpTag(key,value)
pyexiv2.ImageMetadata.__setitem__(self,key,value)
def __setitem__(self,key,value):
try:
pyexiv2.ImageMetadata.__setitem__(self,key,value)
except TypeError:
if key.startswith('Exif'):
value=pyexiv2.ExifTag(key,value)
elif key.startswith('Iptc'):
value=pyexiv2.IptcTag(key,value)
elif key.startswith('Xmp'):
value=pyexiv2.XmpTag(key,value)
pyexiv2.ImageMetadata.__setitem__(self,key,value)