From 022e18dc6f3eee6b9cec47a99f5b099d0f5d1c59 Mon Sep 17 00:00:00 2001 From: Robin Mills Date: Tue, 18 Oct 2016 06:35:19 +0000 Subject: [PATCH] #1244 Fix crwimage.cpp to read into memory (to make CRW work with RemoteIo). --- src/crwimage.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/crwimage.cpp b/src/crwimage.cpp index 8059ce77..883948c1 100644 --- a/src/crwimage.cpp +++ b/src/crwimage.cpp @@ -131,6 +131,16 @@ namespace Exiv2 { throw Error(33); } clearMetadata(); + // read all metadata into memory + // we should put this into clearMetadata(), however it breaks the test suite! + try { + std::ofstream devnull; + printStructure(devnull,kpsRecursive,0); + } catch (Exiv2::Error& e) { + DataBuf file(io().size()); + io_->read(file.pData_,file.size_); + } + CrwParser::decode(this, io_->mmap(), io_->size()); } // CrwImage::readMetadata