aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2010-11-30 20:47:42 +0100
committerOlivier Tilloy <olivier@tilloy.net>2010-11-30 20:47:42 +0100
commit95ed963c2cdbdeff64fc70168d44ac9e47d051d2 (patch)
tree84b9232b96bef4749fde19daf89cc79ddea28f6b /src
parentbd8fdd0665f848a566ccfee0b8dff9c67a52488b (diff)
downloadpyexiv2-95ed963c2cdbdeff64fc70168d44ac9e47d051d2.tar.gz
Accept Fraction objects for Rational values in XMP tags.
Diffstat (limited to 'src')
-rw-r--r--src/pyexiv2/xmp.py5
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)