diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-02-04 20:20:53 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-02-04 20:20:53 +0100 |
commit | dc9b63f76b056a9ed4c10c701511f50da4491e09 (patch) | |
tree | f29a2c02396184909c6e51abdb072f68d5309dca /src | |
parent | 2b3f22c1710a96de655af3cb98a8191baeb802be (diff) | |
download | pyexiv2-dc9b63f76b056a9ed4c10c701511f50da4491e09.tar.gz |
XMP Integer to string conversion + unit tests.
Diffstat (limited to 'src')
-rw-r--r-- | src/pyexiv2.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py index 1b54782..a24492c 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -608,6 +608,7 @@ class XmpTag(MetadataTag): elif xtype == 'Locale': # TODO + # See RFC 3066 raise NotImplementedError('XMP conversion for type [%s]' % xtype) elif xtype == 'MIMEType': @@ -633,7 +634,6 @@ class XmpTag(MetadataTag): raise NotImplementedError('XMP conversion for type [%s]' % xtype) elif xtype in ('URI', 'URL'): - # TODO: use urlparse? return value elif xtype == 'XPath': @@ -660,6 +660,12 @@ class XmpTag(MetadataTag): if xtype == 'Boolean' and type(value) is bool: return str(value) + elif xtype == 'Integer': + if type(value) in (int, long): + return str(value) + else: + raise XmpValueError(value, xtype) + elif xtype == 'Text': if type(value) is unicode: try: |