From 5f48c8e9a67e1ab34220aecfc419fb6c6acf85b2 Mon Sep 17 00:00:00 2001 From: Andreas Huggel Date: Sat, 10 Jun 2006 14:34:58 +0000 Subject: [PATCH] Create a CommentValue rather than a DataValue for Exif.Photo.UserComment. Fixes Bug #471 --- src/tiffvisitor.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/tiffvisitor.cpp b/src/tiffvisitor.cpp index b61bca42..643a581f 100644 --- a/src/tiffvisitor.cpp +++ b/src/tiffvisitor.cpp @@ -782,7 +782,16 @@ namespace Exiv2 { // todo: adjust count_, make size_ a multiple of typeSize } } - Value::AutoPtr v = Value::create(object->typeId()); + // On the fly type conversion for Exif.Photo.UserComment + // Todo: This should be somewhere else, maybe in a Value factory + // which takes a Key and Type + TypeId t = TypeId(object->typeId()); + if ( object->tag() == 0x9286 + && object->group() == Group::exif + && object->typeId() == undefined) { + t = comment; + } + Value::AutoPtr v = Value::create(t); if (v.get()) { v->read(object->pData(), object->size(), byteOrder()); object->pValue_ = v.release();