From ca20598ddeba62b99c80f3fb798516f148f06085 Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sun, 17 Oct 2010 08:26:14 +0100 Subject: [PATCH] More path optimisation Fixes: https://launchpad.net/bugs/661965 --- openlp/core/ui/maindisplay.py | 5 +++-- openlp/core/ui/slidecontroller.py | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/openlp/core/ui/maindisplay.py b/openlp/core/ui/maindisplay.py index 0c9d8734f..d8dabd315 100644 --- a/openlp/core/ui/maindisplay.py +++ b/openlp/core/ui/maindisplay.py @@ -231,8 +231,9 @@ class MainDisplay(DisplayWidget): The Image to be displayed can be QImage or QPixmap """ log.debug(u'image to display') - image = resize_image(image, self.screen[u'size'].width(), - self.screen[u'size'].height()) + if not isinstance(image, QtGui.QImage): + image = resize_image(image, self.screen[u'size'].width(), + self.screen[u'size'].height()) self.resetVideo() self.displayImage(image) # show screen diff --git a/openlp/core/ui/slidecontroller.py b/openlp/core/ui/slidecontroller.py index 3cbe947f1..78ac70b86 100644 --- a/openlp/core/ui/slidecontroller.py +++ b/openlp/core/ui/slidecontroller.py @@ -585,7 +585,13 @@ class SlideController(QtGui.QWidget): label = QtGui.QLabel() label.setMargin(4) label.setScaledContents(True) - label.setPixmap(QtGui.QPixmap.fromImage(frame[u'image'])) + if isinstance(frame[u'image'], QtGui.QImage): + label.setPixmap(QtGui.QPixmap.fromImage(frame[u'image'])) + else: + pixmap = resize_image(frame[u'image'], + self.parent.RenderManager.width, + self.parent.RenderManager.height) + label.setPixmap(QtGui.QPixmap.fromImage(pixmap)) self.PreviewListWidget.setCellWidget(framenumber, 0, label) slideHeight = width * self.parent.RenderManager.screen_ratio row += 1