aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOlivier Tilloy <olivier@tilloy.net>2009-03-09 19:39:54 +0100
committerOlivier Tilloy <olivier@tilloy.net>2009-03-09 19:39:54 +0100
commitab8fda2c128eeaa45f71d2e27da7e627c439d251 (patch)
tree7727293be16f8b844e6ce8dac9d381f101042a7c /src
parent3c23acdb070d2c3230f3ecf497b4fbd760f5a10e (diff)
downloadpyexiv2-ab8fda2c128eeaa45f71d2e27da7e627c439d251.tar.gz
EXIF Undefined to string conversion.
Diffstat (limited to 'src')
-rw-r--r--src/pyexiv2.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py
index 9102011..fbb638c 100644
--- a/src/pyexiv2.py
+++ b/src/pyexiv2.py
@@ -567,8 +567,15 @@ class ExifTag(MetadataTag):
raise ExifValueError(value, xtype)
elif xtype == 'Undefined':
- # TODO
- raise NotImplementedError('EXIF conversion for type [%s]' % xtype)
+ if type(value) is unicode:
+ try:
+ return value.encode('utf-8')
+ except UnicodeEncodeError:
+ raise ExifValueError(value, xtype)
+ elif type(value) is str:
+ return value
+ else:
+ raise ExifValueError(value, xtype)
# TODO: other types