Found that downsample would set the image size to 0 causing errors.

This commit is contained in:
HashSplat 2017-08-08 15:35:54 -04:00
parent 70831245a8
commit e7ba0ca272

View File

@ -368,6 +368,10 @@ class ImageItem(GraphicsObject):
image = fn.downsample(self.image, xds, axis=axes[0])
image = fn.downsample(image, yds, axis=axes[1])
self._lastDownsample = (xds, yds)
# Check if downsampling reduced the image size to zero due to inf values.
if image.size == 0:
return
else:
image = self.image
@ -401,8 +405,7 @@ class ImageItem(GraphicsObject):
image = image.transpose((1, 0, 2)[:image.ndim])
argb, alpha = fn.makeARGB(image, lut=lut, levels=levels)
if argb.size > 0:
self.qimage = fn.makeQImage(argb, alpha, transpose=False)
self.qimage = fn.makeQImage(argb, alpha, transpose=False)
def paint(self, p, *args):
profile = debug.Profiler()