Found that downsample would set the image size to 0 causing errors.
This commit is contained in:
parent
70831245a8
commit
e7ba0ca272
@ -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,7 +405,6 @@ 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)
|
||||
|
||||
def paint(self, p, *args):
|
||||
|
Loading…
Reference in New Issue
Block a user