diff --git a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx index 776b09fa45e894afe8efe0feb2980410de48b3bd..ba74e3ed2f2816d304c76570f23644f5dbacc4e3 100644 --- a/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx +++ b/Modules/Wrappers/ApplicationEngine/src/otbWrapperApplication.cxx @@ -388,6 +388,22 @@ int Application::Execute() } this->DoExecute(); + + // Ensure that all output image parameter have called UpdateOutputInformation() + for (auto it = paramList.begin(); it != paramList.end(); ++it) + { + OutputImageParameter * outImgParamPtr = dynamic_cast<OutputImageParameter *>(GetParameterByKey(*it)); + // If this is an OutputImageParameter + if(outImgParamPtr != ITK_NULLPTR) + { + // If the parameter is enabled + if(IsParameterEnabled(*it)) + { + // Call UpdateOutputInformation() + outImgParamPtr->GetValue()->UpdateOutputInformation(); + } + } + } return 0; }