From aae8b5b81132c4b0f894501c7273d8f7c3c9e357 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 21 Aug 2019 21:45:05 +0200 Subject: [PATCH] Fix test --- openlp/core/widgets/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/openlp/core/widgets/views.py b/openlp/core/widgets/views.py index e80e46cf4..a1d065307 100644 --- a/openlp/core/widgets/views.py +++ b/openlp/core/widgets/views.py @@ -210,7 +210,10 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties): pixmap = QtGui.QPixmap(str(slide['image'])) else: pixmap = QtGui.QPixmap(str(slide['path'])) - pixmap_ratio = pixmap.width() / pixmap.height() + if pixmap.height() > 0: + pixmap_ratio = pixmap.width() / pixmap.height() + else: + pixmap_ratio = 1 label.setPixmap(pixmap) container = QtWidgets.QWidget() layout = AspectRatioLayout(container, pixmap_ratio)