From c6501e454229132808853648b818499ea4888f58 Mon Sep 17 00:00:00 2001 From: Olivier Tilloy Date: Wed, 4 Feb 2009 20:30:37 +0100 Subject: XMP MIMEType to string conversion + unit tests. --- src/pyexiv2.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/pyexiv2.py b/src/pyexiv2.py index a24492c..8bb398a 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -666,6 +666,15 @@ class XmpTag(MetadataTag): else: raise XmpValueError(value, xtype) + elif xtype == 'MIMEType': + if type(value) is dict: + try: + return '%s/%s' % (value['type'], value['subtype']) + except KeyError: + raise XmpValueError(value, xtype) + else: + raise XmpValueError(value, xtype) + elif xtype == 'Text': if type(value) is unicode: try: -- cgit