diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2009-03-18 08:40:53 +0100 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2009-03-18 08:40:53 +0100 |
commit | 07fc60f27fe4f26e35ee02df9d5439a7ec42bafb (patch) | |
tree | 23d7ce543f5e99f7f087372c26769848f3844753 | |
parent | 1fee371f1496cd2f13b410e00469b307dd56d703 (diff) | |
download | pyexiv2-07fc60f27fe4f26e35ee02df9d5439a7ec42bafb.tar.gz |
Handle multiple values for EXIF tags (e.g. Exif.GPSInfo.GPSLatitude is expressed as three Rationals).
-rw-r--r-- | src/pyexiv2.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pyexiv2.py b/src/pyexiv2.py index 46128ea..3c9f4c0 100644 --- a/src/pyexiv2.py +++ b/src/pyexiv2.py @@ -309,6 +309,12 @@ class ExifTag(MetadataTag): """ super(ExifTag, self).__init__(key, name, label, description, xtype, value) self.fvalue = fvalue + if xtype in ('Short', 'Long', 'SLong', 'Rational', 'SRational'): + # May contain multiple values + values = value.split() + if len(values) > 1: + self.value = map(lambda x: ExifTag._convert_to_python(x, xtype), values) + return self.value = ExifTag._convert_to_python(value, xtype, fvalue) @staticmethod |