diff --git a/Code/IO/otbMWImageIO.cxx b/Code/IO/otbMWImageIO.cxx index 868773dc511a1872f06f4205a82f65ce5ad5795d..acbee4fd41397528a14458109d1bfef76fa8a3cf 100644 --- a/Code/IO/otbMWImageIO.cxx +++ b/Code/IO/otbMWImageIO.cxx @@ -213,7 +213,10 @@ bool MWImageIO::InternalReadHeaderInformation(std::fstream & file, const bool re } else { - itkExceptionMacro(<< "MW : impossible to determine CodePix information of the image"); + if( reportError == true ) + { + itkExceptionMacro(<< "MW : impossible to determine CodePix information of the image"); + } return false; }