aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-05-19 14:53:11 +0200
committerOlivier Tilloy <olivier@tilloy.net>2010-05-19 14:53:11 +0200
commit1ba51c22bfc6202f23c66b0e13418af8546cfe73 (patch)
treed5dd8de7b3db0453b29a577d40e8f90d8b448203
parent08a8242f41911619238899fcd538fb0fcff6e3d6 (diff)
parent589647589c93edc2382a3f3c2194e553774c0665 (diff)
downloadpyexiv2-1ba51c22bfc6202f23c66b0e13418af8546cfe73.tar.gz
Do not re-set the value of a tag when reading it.
-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