From c6167258ce61722eefc40cf95e5580fa720fcb09 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Mon, 14 Dec 2020 20:15:42 +0000 Subject: [PATCH] Revert "Restored 0.27.2 "toString()" behaviour of Exifdatum.value().toString() for CommentValue." This reverts commit ecae9dc6eba437d9ef568e3b3b377932ff76f309. --- src/exif.cpp | 12 ++---------- src/value.cpp | 4 ++++ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/exif.cpp b/src/exif.cpp index 78c8ae08..493fd20b 100644 --- a/src/exif.cpp +++ b/src/exif.cpp @@ -226,16 +226,8 @@ namespace Exiv2 { if ( ti ) { fct = ti->printFct_; if ( ti->typeId_ == comment ) { - fct=NULL; - const Exiv2::CommentValue* cv = dynamic_cast(&value()); - Exiv2::CommentValue::CharsetId csId = cv->charsetId(); - if ( csId != CommentValue::undefined ) { - os << "charset=" << CommentValue::CharsetInfo::name(csId) << " "; - } - os << cv->comment(); -#if 0 - os << "|| value().toString() = " << value().toString(); -#endif + os << value().toString(); + fct=NULL; } } if ( fct ) fct(os, value(), pMetadata); diff --git a/src/value.cpp b/src/value.cpp index 429ca142..5bd815e2 100644 --- a/src/value.cpp +++ b/src/value.cpp @@ -548,6 +548,10 @@ namespace Exiv2 { std::ostream& CommentValue::write(std::ostream& os) const { + CharsetId csId = charsetId(); + if (csId != undefined) { + os << "charset=" << CharsetInfo::name(csId) << " "; + } return os << comment(); }