diff --git a/rtengine/iimage.h b/rtengine/iimage.h index 0a73a87cc..d0fe626c2 100644 --- a/rtengine/iimage.h +++ b/rtengine/iimage.h @@ -126,6 +126,11 @@ inline void ImageDatas::convertTo(unsigned char src, float& dst) const { dst = src * 257; } +template<> +inline void ImageDatas::convertTo(float src, float& dst) const +{ + dst = std::isnan(src) ? 0.f : src; +} // -------------------------------------------------------------------- // Planar order classes