diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2010-11-30 20:47:42 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2010-11-30 20:47:42 +0100 |
commit | 95ed963c2cdbdeff64fc70168d44ac9e47d051d2 (patch) | |
tree | 84b9232b96bef4749fde19daf89cc79ddea28f6b /src | |
parent | bd8fdd0665f848a566ccfee0b8dff9c67a52488b (diff) | |
download | pyexiv2-95ed963c2cdbdeff64fc70168d44ac9e47d051d2.tar.gz |
Accept Fraction objects for Rational values in XMP tags.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyexiv2/xmp.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pyexiv2/xmp.py b/src/pyexiv2/xmp.py index 2142c41..f13db7b 100644 --- a/src/pyexiv2/xmp.py +++ b/src/pyexiv2/xmp.py @@ -30,7 +30,7 @@ XMP specific code. import libexiv2python -from pyexiv2.utils import FixedOffset, Rational, GPSCoordinate +from pyexiv2.utils import FixedOffset, Rational, Fraction, GPSCoordinate import datetime import re @@ -435,7 +435,8 @@ class XmpTag(object): raise XmpValueError(value, type) elif type == 'Rational': - if isinstance(value, Rational): + if isinstance(value, Rational) or \ + (Fraction is not None and isinstance(value, Fraction)): return str(value) else: raise XmpValueError(value, type) |