Fix image but and more path optimisation

bzr-revno: 1095
Fixes: https://launchpad.net/bugs/661965
This commit is contained in:
Tim Bentley 2010-10-17 14:32:40 +01:00
commit cf139be7cb
2 changed files with 10 additions and 3 deletions

View File

@ -231,8 +231,9 @@ class MainDisplay(DisplayWidget):
The Image to be displayed can be QImage or QPixmap The Image to be displayed can be QImage or QPixmap
""" """
log.debug(u'image to display') log.debug(u'image to display')
image = resize_image(image, self.screen[u'size'].width(), if not isinstance(image, QtGui.QImage):
self.screen[u'size'].height()) image = resize_image(image, self.screen[u'size'].width(),
self.screen[u'size'].height())
self.resetVideo() self.resetVideo()
self.displayImage(image) self.displayImage(image)
# show screen # show screen

View File

@ -585,7 +585,13 @@ class SlideController(QtGui.QWidget):
label = QtGui.QLabel() label = QtGui.QLabel()
label.setMargin(4) label.setMargin(4)
label.setScaledContents(True) 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) self.PreviewListWidget.setCellWidget(framenumber, 0, label)
slideHeight = width * self.parent.RenderManager.screen_ratio slideHeight = width * self.parent.RenderManager.screen_ratio
row += 1 row += 1