diff --git a/Modules/Filtering/ImageManipulation/include/otbChangeNoDataValueFilter.h b/Modules/Filtering/ImageManipulation/include/otbChangeNoDataValueFilter.h index d19f2184a37551610df37d07b0cabbe1ef789ebf..b4e8149461e292216e26c64e3963728a4746ac6a 100644 --- a/Modules/Filtering/ImageManipulation/include/otbChangeNoDataValueFilter.h +++ b/Modules/Filtering/ImageManipulation/include/otbChangeNoDataValueFilter.h @@ -80,12 +80,17 @@ public: * - NaN values will be considered as no data and replaced as well * - Output image will have no-data flags and values for all bands * - * If NaNIsNoData is false: + * If NaNIsNoData is false and the input has at least one band with no-data + * flag and no-data value : * - Band for which input no-data flags is false will remain * untouched * - Output image will have no-data flags and values only for bands * for which input no-data flag is true. * + * If NaNIsNoData is false and the input has no band with no-data + * flag and no-data value : + * - Output image will have no-data flags and values for all bands + * * \ingroup Streamed * \ingroup MultiThreaded * \ingroup OTBImageManipulation @@ -160,7 +165,7 @@ protected: std::vector<bool> flags = noDataValueAvailable; - if(this->GetFunctor().m_NaNIsNoData) + if((this->GetFunctor().m_NaNIsNoData) || (!ret)) { flags = std::vector<bool>(flags.size(),true); }