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(self.image, xds, axis=axes[0])
|
||||||
image = fn.downsample(image, yds, axis=axes[1])
|
image = fn.downsample(image, yds, axis=axes[1])
|
||||||
self._lastDownsample = (xds, yds)
|
self._lastDownsample = (xds, yds)
|
||||||
|
|
||||||
|
# Check if downsampling reduced the image size to zero due to inf values.
|
||||||
|
if image.size == 0:
|
||||||
|
return
|
||||||
else:
|
else:
|
||||||
image = self.image
|
image = self.image
|
||||||
|
|
||||||
@ -401,8 +405,7 @@ class ImageItem(GraphicsObject):
|
|||||||
image = image.transpose((1, 0, 2)[:image.ndim])
|
image = image.transpose((1, 0, 2)[:image.ndim])
|
||||||
|
|
||||||
argb, alpha = fn.makeARGB(image, lut=lut, levels=levels)
|
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):
|
def paint(self, p, *args):
|
||||||
profile = debug.Profiler()
|
profile = debug.Profiler()
|
||||||
|
Loading…
Reference in New Issue
Block a user