aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/pyexiv2/exif.py5
-rw-r--r--src/pyexiv2/iptc.py6
-rw-r--r--src/pyexiv2/xmp.py10
3 files changed, 16 insertions, 5 deletions
diff --git a/src/pyexiv2/exif.py b/src/pyexiv2/exif.py
index 6f2f824..6964b4b 100644
--- a/src/pyexiv2/exif.py
+++ b/src/pyexiv2/exif.py
@@ -111,7 +111,10 @@ class ExifTag(ListenerInterface):
def _from_existing_tag(_tag):
# Build a tag from an already existing libexiv2python._ExifTag.
tag = ExifTag(_tag._getKey(), _tag=_tag)
- tag.raw_value = _tag._getRawValue()
+ # Do not set the raw_value property, as it would call _tag._setRawValue
+ # (see https://bugs.launchpad.net/pyexiv2/+bug/582445).
+ tag._raw_value = _tag._getRawValue()
+ tag._value_cookie = True
return tag
@property
diff --git a/src/pyexiv2/iptc.py b/src/pyexiv2/iptc.py
index 53d82dc..f92e883 100644
--- a/src/pyexiv2/iptc.py
+++ b/src/pyexiv2/iptc.py
@@ -107,7 +107,11 @@ class IptcTag(ListenerInterface):
def _from_existing_tag(_tag):
# Build a tag from an already existing libexiv2python._IptcTag
tag = IptcTag(_tag._getKey(), _tag=_tag)
- tag.raw_values = _tag._getRawValues()
+ # Do not set the raw_values property, as it would call
+ # _tag._setRawValues
+ # (see https://bugs.launchpad.net/pyexiv2/+bug/582445).
+ tag._raw_values = _tag._getRawValues()
+ tag._values_cookie = True
return tag
@property
diff --git a/src/pyexiv2/xmp.py b/src/pyexiv2/xmp.py
index f4954d5..63fe0a4 100644
--- a/src/pyexiv2/xmp.py
+++ b/src/pyexiv2/xmp.py
@@ -120,12 +120,16 @@ class XmpTag(object):
# Build a tag from an already existing libexiv2python._XmpTag
tag = XmpTag(_tag._getKey(), _tag=_tag)
type = _tag._getExiv2Type()
+ # Do not set the raw_value property, as it would call
+ # _tag._set{Text,Array,LangAlt}Value
+ # (see https://bugs.launchpad.net/pyexiv2/+bug/582445).
if type == 'XmpText':
- tag.raw_value = _tag._getTextValue()
+ tag._raw_value = _tag._getTextValue()
elif type in ('XmpAlt', 'XmpBag', 'XmpSeq'):
- tag.raw_value = _tag._getArrayValue()
+ tag._raw_value = _tag._getArrayValue()
elif type == 'LangAlt':
- tag.raw_value = _tag._getLangAltValue()
+ tag._raw_value = _tag._getLangAltValue()
+ tag._value_cookie = True
return tag
@property