aboutsummaryrefslogtreecommitdiff
path: root/src/components/spectrum.py
diff options
context:
space:
mode:
authortassaron2017-08-03 00:44:46 -0400
committertassaron2017-08-03 00:44:46 -0400
commit6611492b30a7daf7bdbe77f6e12f9d322bdd90c1 (patch)
tree57826b56646ccf81a7954af7daa4eb10632f2b32 /src/components/spectrum.py
parent62431a3cfebdc8490b7010d71b8e646dd6bd0d35 (diff)
relative gradients & last good frame used for preview errors
Diffstat (limited to 'src/components/spectrum.py')
-rw-r--r--src/components/spectrum.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/components/spectrum.py b/src/components/spectrum.py
index 2cc641d..9a0c59a 100644
--- a/src/components/spectrum.py
+++ b/src/components/spectrum.py
@@ -20,6 +20,7 @@ class Component(Component):
def widget(self, *args):
self.previewFrame = None
super().widget(*args)
+ self._image = BlankFrame(self.width, self.height)
self.chunkSize = 4 * self.width * self.height
self.changedOptions = True
@@ -268,11 +269,15 @@ class Component(Component):
return changed
def finalizeFrame(self, imageData):
- image = Image.frombytes(
- 'RGBA',
- scale(self.scale, self.width, self.height, int),
- imageData
- )
+ try:
+ image = Image.frombytes(
+ 'RGBA',
+ scale(self.scale, self.width, self.height, int),
+ imageData
+ )
+ self._image = image
+ except ValueError:
+ image = self._image
if self.scale != 100 \
or self.x != 0 or self.y != 0:
frame = BlankFrame(self.width, self.height)