aboutsummaryrefslogtreecommitdiff
path: root/src/preview_thread.py
diff options
context:
space:
mode:
authortassaron2017-06-24 23:12:41 -0400
committertassaron2017-06-24 23:12:41 -0400
commite32ba958cb95146728d4985221b08c7e01b35470 (patch)
tree1fce99082617a5a92a758851e51c32999774d212 /src/preview_thread.py
parent4d955c5a06d8d77c968f594a85b71b516919bcfb (diff)
fixing bugs
Diffstat (limited to 'src/preview_thread.py')
-rw-r--r--src/preview_thread.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/preview_thread.py b/src/preview_thread.py
index 4a46d51..ac5751d 100644
--- a/src/preview_thread.py
+++ b/src/preview_thread.py
@@ -49,8 +49,19 @@ class Worker(QtCore.QObject):
components = nextPreviewInformation["components"]
for component in reversed(components):
- frame = Image.alpha_composite(
- frame, component.previewRender(self))
+ try:
+ newFrame = component.previewRender(self)
+ frame = Image.alpha_composite(
+ frame, newFrame)
+ except ValueError:
+ self.parent.showMessage(
+ msg="Bad frame returned by %s's previewRender method. "
+ "This is a fatal error." %
+ str(component),
+ detail="bad frame: w%s, h%s" % (
+ newFrame.width, newFrame.height)
+ )
+ quit(1)
self._image = ImageQt(frame)
self.imageCreated.emit(QtGui.QImage(self._image))