diff --git a/src/actions.cpp b/src/actions.cpp index cebc638c..b0f55bf5 100644 --- a/src/actions.cpp +++ b/src/actions.cpp @@ -698,7 +698,15 @@ namespace Action { done = true; } } - if (!done) std::cout << std::dec << md.value(); + if (!done) { + // #1114 - show negative values for SByte + if (md.typeId() != Exiv2::signedByte){ + std::cout << std::dec << md.value(); + } else { + int value = md.value().toLong(); + std::cout << std::dec << (value<128?value:value-255); + } + } } if (Params::instance().printItems_ & Params::prTrans) { if (!first) std::cout << " "; @@ -1122,20 +1130,20 @@ namespace Action { } Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(path_); assert(image.get() != 0); - image->readMetadata(); + image->readMetadata(); - std::string iccPath = newFilePath(path_,".icc"); - std::filebuf iccBuffer ; - iccBuffer.open(iccPath.c_str(),std::ios::out); - std::ostream iccStream(&iccBuffer); + std::string iccPath = newFilePath(path_,".icc"); + std::filebuf iccBuffer ; + iccBuffer.open(iccPath.c_str(),std::ios::out); + std::ostream iccStream(&iccBuffer); - image->printStructure(iccStream,Exiv2::kpsIccProfile); + image->printStructure(iccStream,Exiv2::kpsIccProfile); - iccBuffer.close(); + iccBuffer.close(); if (Params::instance().verbose_) { std::cout << _("Writing iccProfile: ") << iccPath << std::endl; } - return 0; + return 0; } // Extract::writeIccProfile diff --git a/test/bugfixes-test.sh b/test/bugfixes-test.sh index 36b5e83c..6e0c5282 100755 --- a/test/bugfixes-test.sh +++ b/test/bugfixes-test.sh @@ -405,6 +405,14 @@ source ./functions.source copyTestFile $filename runTest exiv2 -M 'del Xmp.dc.title' $filename cat $filename + echo '' + + num=1114 + filename=exiv2-bug$num.jpg + printf "$num " >&3 + echo '------>' Bug $num '<-------' >&2 + copyTestFile $filename + runTest exiv2 -pv -g TuneAdj $filename ) 3>&1 > $results 2>&1 diff --git a/test/data/bugfixes-test.out b/test/data/bugfixes-test.out index 8b2bda92..3806e2b6 100644 Binary files a/test/data/bugfixes-test.out and b/test/data/bugfixes-test.out differ diff --git a/test/data/exiv2-bug1114.jpg b/test/data/exiv2-bug1114.jpg new file mode 100644 index 00000000..011343e4 Binary files /dev/null and b/test/data/exiv2-bug1114.jpg differ