diff options
| author | tassaron | 2017-06-25 10:36:32 -0400 |
|---|---|---|
| committer | tassaron | 2017-06-25 10:36:32 -0400 |
| commit | a2838a0c3898f999e71f76e6e8d5691155438aea (patch) | |
| tree | c65d2d5c908f472389dee4d1e03f8fe88e88dacf /src/components | |
| parent | 45b55d8e2fbffceefc9a1cd50b9bdb3e7ec9da78 (diff) | |
disable some hotkeys while encoding, more friendly error messages
Diffstat (limited to 'src/components')
| -rw-r--r-- | src/components/video.py | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/src/components/video.py b/src/components/video.py index 3e87d2e..44f88a5 100644 --- a/src/components/video.py +++ b/src/components/video.py @@ -86,12 +86,14 @@ class Video: continue except AttributeError as e: self.parent.showMessage( - msg='%s couldn\'t be loaded.' % os.path.basename( + msg='%s couldn\'t be loaded. ' + 'This is a fatal error.' % os.path.basename( self.videoPath ), detail=str(e) ) self.parent.stopVideo() + break self.currentFrame = pipe.stdout.read(self.chunkSize) if len(self.currentFrame) != 0: @@ -258,20 +260,24 @@ def scale(scale, width, height, returntype=None): def finalizeFrame(self, imageData, width, height): - if self.distort: - try: + try: + if self.distort: image = Image.frombytes( 'RGBA', (width, height), imageData) - except ValueError: - print('#### ignored invalid data caused by distortion ####') - image = self.blankFrame(width, height) - else: - image = Image.frombytes( - 'RGBA', - scale(self.scale, width, height, int), - imageData) + else: + image = Image.frombytes( + 'RGBA', + scale(self.scale, width, height, int), + imageData) + + except ValueError: + print( + '### BAD VIDEO SELECTED ###\n' + 'Video will not export with these settings' + ) + return self.blankFrame(width, height) if self.scale != 100 \ or self.xPosition != 0 or self.yPosition != 0: |
