diff Framework/Inputs/DicomPyramidInstance.cpp @ 269:30fb01ce97a3 iiif

integration mainline->iiif
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Jul 2023 16:23:46 +0200
parents dab414e5b520 a6e4834ac141
children 7020852a8fa9
line wrap: on
line diff
--- a/Framework/Inputs/DicomPyramidInstance.cpp	Mon Jul 10 15:46:19 2023 +0200
+++ b/Framework/Inputs/DicomPyramidInstance.cpp	Mon Jul 10 16:23:46 2023 +0200
@@ -190,7 +190,7 @@
         throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
       }
 
-      frames_.resize(countFrames);
+      frames_.reserve(countFrames);
 
       for (size_t i = 0; i < countFrames; i++)
       {
@@ -225,11 +225,11 @@
         {
           LOG(ERROR) << "Frame " << i << " with unexpected tile location (" 
                      << x << "," << y << ") in instance: " << instanceId;
-          throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat);
         }
-
-        frames_[i].first = x / tileWidth_;
-        frames_[i].second = y / tileHeight_;
+        else
+        {
+          frames_.push_back(std::make_pair(x / tileWidth_, y / tileHeight_));
+        }
       }
     }
     else