diff options
author | Olivier Tilloy <olivier@tilloy.net> | 2011-08-20 12:04:56 +0200 |
---|---|---|
committer | Olivier Tilloy <olivier@tilloy.net> | 2011-08-20 12:04:56 +0200 |
commit | 540db70d10def3cda4edd36ff175cd1af877241e (patch) | |
tree | 9aed3f67193ec7d1d3f3802ccb47764f040c15b9 | |
parent | 60d2410d5fbbfd039a418d87678a388952c4d95a (diff) | |
download | pyexiv2-540db70d10def3cda4edd36ff175cd1af877241e.tar.gz |
Special case for the 'Comment' type.
-rw-r--r-- | src/exiv2wrapper.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/exiv2wrapper.cpp b/src/exiv2wrapper.cpp index 071d916..0033b23 100644 --- a/src/exiv2wrapper.cpp +++ b/src/exiv2wrapper.cpp @@ -553,14 +553,14 @@ ExifTag::ExifTag(const std::string& key, // (see https://bugs.launchpad.net/pyexiv2/+bug/684177). #if EXIV2_TEST_VERSION(0,21,0) Exiv2::ExifKey exifKey(key); - if (_data != 0) + _type = Exiv2::TypeInfo::typeName(exifKey.defaultTypeId()); + // Where available, extract the type from the metadata, it is more reliable + // than static type information. The exception is for user comments, for + // which we’d rather keep the 'Comment' type instead of 'Undefined'. + if ((_data != 0) && (_type != "Comment")) { _type = _datum->typeName(); } - else - { - _type = Exiv2::TypeInfo::typeName(exifKey.defaultTypeId()); - } _name = exifKey.tagName(); _label = exifKey.tagLabel(); _description = exifKey.tagDesc(); |