From 9ccbd52ee49664ef37b44fb3df920c5571d5b11e Mon Sep 17 00:00:00 2001 From: Marina Bertolino <marina.bertolino@c-s.fr> Date: Tue, 24 Oct 2017 09:05:08 +0200 Subject: [PATCH] ENH: change shrinkFactor calculation in DynamicConvert --- Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx index 2c982c66c6..a714194faf 100644 --- a/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx +++ b/Modules/Applications/AppImageUtils/app/otbDynamicConvert.cxx @@ -243,8 +243,7 @@ private: // Shrink factor is computed so as to load a quicklook of 1000 // pixels square at most auto imageSize = tempImage->GetLargestPossibleRegion().GetSize(); - unsigned int shrinkFactor = - std::max(imageSize[0], imageSize[1]) < 1000 ? 1 : std::max(imageSize[0], imageSize[1])/1000; + unsigned int shrinkFactor = std::max({int(imageSize[0])/1000, int(imageSize[1])/1000, 1}); otbAppLogDEBUG( << "Shrink factor used to compute Min/Max: "<<shrinkFactor ); otbAppLogDEBUG( << "Shrink starts..." ); -- GitLab