forked from openlp/openlp
Remove transparent error: QImage::scaled: Image is a null image
This commit is contained in:
parent
4e8b3e29bc
commit
8524bf9174
@ -144,8 +144,9 @@ def resize_image(image, width, height):
|
||||
The image to resize.
|
||||
"""
|
||||
preview = QtGui.QImage(image)
|
||||
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
if not preview.isNull():
|
||||
preview = preview.scaled(width, height, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
realw = preview.width()
|
||||
realh = preview.height()
|
||||
# and move it to the centre of the preview space
|
||||
|
@ -159,9 +159,10 @@ class ThemesTab(SettingsTab):
|
||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||
self.global_theme)
|
||||
preview = QtGui.QPixmap(unicode(image))
|
||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
self.DefaultListView.setPixmap(display)
|
||||
if not preview.isNull():
|
||||
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
self.DefaultListView.setPixmap(preview)
|
||||
|
||||
def updateThemeList(self, theme_list):
|
||||
"""
|
||||
@ -184,6 +185,7 @@ class ThemesTab(SettingsTab):
|
||||
image = self.parent.ThemeManagerContents.getPreviewImage(
|
||||
self.global_theme)
|
||||
preview = QtGui.QPixmap(unicode(image))
|
||||
display = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
self.DefaultListView.setPixmap(display)
|
||||
if not preview.isNull():
|
||||
preview = preview.scaled(300, 255, QtCore.Qt.KeepAspectRatio,
|
||||
QtCore.Qt.SmoothTransformation)
|
||||
self.DefaultListView.setPixmap(preview)
|
||||
|
Loading…
Reference in New Issue
Block a user