aboutsummaryrefslogtreecommitdiff
path: root/src/components/waveform.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/waveform.py
parent62431a3cfebdc8490b7010d71b8e646dd6bd0d35 (diff)
relative gradients & last good frame used for preview errors
Diffstat (limited to 'src/components/waveform.py')
-rw-r--r--src/components/waveform.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/components/waveform.py b/src/components/waveform.py
index a25116b..526e6fb 100644
--- a/src/components/waveform.py
+++ b/src/components/waveform.py
@@ -19,6 +19,7 @@ class Component(Component):
def widget(self, *args):
super().widget(*args)
+ self._image = BlankFrame(self.width, self.height)
self.page.lineEdit_color.setText('255,255,255')
@@ -178,11 +179,15 @@ class Component(Component):
self.chunkSize = 4 * width * height
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)