This commit is contained in:
Tomas Groth 2019-08-21 21:45:05 +02:00
parent 62ca28cf09
commit aae8b5b811

View File

@ -210,7 +210,10 @@ class ListPreviewWidget(QtWidgets.QTableWidget, RegistryProperties):
pixmap = QtGui.QPixmap(str(slide['image'])) pixmap = QtGui.QPixmap(str(slide['image']))
else: else:
pixmap = QtGui.QPixmap(str(slide['path'])) pixmap = QtGui.QPixmap(str(slide['path']))
if pixmap.height() > 0:
pixmap_ratio = pixmap.width() / pixmap.height() pixmap_ratio = pixmap.width() / pixmap.height()
else:
pixmap_ratio = 1
label.setPixmap(pixmap) label.setPixmap(pixmap)
container = QtWidgets.QWidget() container = QtWidgets.QWidget()
layout = AspectRatioLayout(container, pixmap_ratio) layout = AspectRatioLayout(container, pixmap_ratio)