How to use the pyexiv2.IptcTag function in pyexiv2

To help you get started, we’ve selected a few pyexiv2 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jim-easterbrook / Photini / src / photini / metadata_pyexiv2.py View on Github external
def set_tag_multiple(self, tag, value):
        if tag.startswith('Iptc'):
            new_tag = pyexiv2.IptcTag(tag, value)
        elif tag.startswith('Xmp'):
            new_tag = pyexiv2.XmpTag(tag)
            if new_tag.type == 'Lang Alt':
                new_tag = pyexiv2.XmpTag(tag, {'x-default': value[0]})
            elif new_tag.type == 'Date':
                new_tag.raw_value = value[0]
            else:
                new_tag = pyexiv2.XmpTag(tag, value)
        self._md[tag] = new_tag
github gramps-project / addons-source / contrib / ImageMetadataGramplet / ImageMetadataGramplet.py View on Github external
try:
                pluginobject[KeyTag].value = KeyValue

            except KeyError:
                pluginobject[KeyTag] = pyexiv2.ExifTag(KeyTag, KeyValue)

            except (ValueError, AttributeError):
                pass

        # Iptc KeyValue family?
        elif "Iptc" in KeyTag:
            try:
                pluginobject[KeyTag].values = KeyValue

            except KeyError:
                pluginobject[KeyTag] = pyexiv2.IptcTag(KeyTag, KeyValue)

            except (ValueError, AttributeError):
                pass

        # Xmp KeyValue family?
        elif "Xmp" in KeyTag:
            try:
                pluginobject[KeyTag].values = KeyValue

            except KeyError:
                pluginobject[KeyTag] = pyexiv2.XmpTag(KeyTag, KeyValue)

            except (ValueError, AttributeError):
                pass
github spillz / picty / modules / picty / metadata / metadata2.py View on Github external
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)