fix for nextafter

This commit is contained in:
Jan Kotanski 2020-01-08 21:19:09 +01:00
parent 0a936a4dc0
commit 65d2ac58e0

View File

@ -1134,7 +1134,9 @@ def makeARGB(data, lut=None, levels=None, scale=None, useRGBA=False):
if minVal != 0 or maxVal != scale:
if minVal == maxVal:
maxVal = np.nextafter(maxVal, 2*maxVal)
data = rescaleData(data, scale/(maxVal-minVal), minVal, dtype=dtype)
rng = maxVal-minVal
rng = 1 if rng == 0 else rng
data = rescaleData(data, scale/rng, minVal, dtype=dtype)
profile()
# apply LUT if given