aboutsummaryrefslogtreecommitdiff
path: root/src/components/waveform.py
diff options
context:
space:
mode:
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)