Blob Blame History Raw
diff --git a/src/cr2image.cpp b/src/cr2image.cpp
index 516e170..8a752b0 100644
--- a/src/cr2image.cpp
+++ b/src/cr2image.cpp
@@ -107,8 +107,6 @@ namespace Exiv2 {
             throw Error(3, "CR2");
         }
         clearMetadata();
-        std::ofstream devnull;
-        printStructure(devnull, kpsRecursive, 0);
         ByteOrder bo = Cr2Parser::decode(exifData_,
                                          iptcData_,
                                          xmpData_,
diff --git a/src/crwimage.cpp b/src/crwimage.cpp
index 232919c..58240fd 100644
--- a/src/crwimage.cpp
+++ b/src/crwimage.cpp
@@ -131,15 +131,8 @@ 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_);
-        }
+        DataBuf file( (long) io().size());
+        io_->read(file.pData_,file.size_);
 
         CrwParser::decode(this, io_->mmap(), io_->size());
 
diff --git a/src/orfimage.cpp b/src/orfimage.cpp
index 25651bd..9bd7a02 100644
--- a/src/orfimage.cpp
+++ b/src/orfimage.cpp
@@ -119,8 +119,6 @@ namespace Exiv2 {
             throw Error(3, "ORF");
         }
         clearMetadata();
-        std::ofstream devnull;
-        printStructure(devnull, kpsRecursive, 0);
         ByteOrder bo = OrfParser::decode(exifData_,
                                          iptcData_,
                                          xmpData_,
diff --git a/src/rw2image.cpp b/src/rw2image.cpp
index 07de437..5922602 100644
--- a/src/rw2image.cpp
+++ b/src/rw2image.cpp
@@ -130,8 +130,6 @@ namespace Exiv2 {
             throw Error(3, "RW2");
         }
         clearMetadata();
-        std::ofstream devnull;
-        printStructure(devnull, kpsRecursive, 0);
         ByteOrder bo = Rw2Parser::decode(exifData_,
                                          iptcData_,
                                          xmpData_,
diff --git a/src/tiffimage.cpp b/src/tiffimage.cpp
index de66068..98da12b 100644
--- a/src/tiffimage.cpp
+++ b/src/tiffimage.cpp
@@ -185,10 +185,6 @@ namespace Exiv2 {
         }
         clearMetadata();
 
-        // recursively print the structure to /dev/null to ensure all metadata is in memory
-        // must be recursive to handle NEFs which stores the raw image in a subIFDs
-        std::ofstream devnull;
-        printStructure(devnull,kpsRecursive,0);
         ByteOrder bo = TiffParser::decode(exifData_,
                                           iptcData_,
                                           xmpData_,
@@ -200,7 +196,7 @@ namespace Exiv2 {
         Exiv2::ExifKey            key("Exif.Image.InterColorProfile");
         Exiv2::ExifData::iterator pos   = exifData_.findKey(key);
         if ( pos != exifData_.end()  ) {
-            iccProfile_.alloc(pos->count());
+            iccProfile_.alloc(pos->count()*pos->typeSize());
             pos->copy(iccProfile_.pData_,bo);
         }