49 for path
in recentDocumentsPaths:
52 extension = Path(path).suffix
54 if extension ==
'.kra':
55 page = zipfile.ZipFile(path,
"r")
56 thumbnail = QImage.fromData(page.read(
"mergedimage.png"))
57 if thumbnail.isNull():
58 thumbnail = QImage.fromData(page.read(
"preview.png"))
60 thumbnail = QImage(path)
62 if thumbnail.isNull():
66 if thumbnail.width() <= thumbSize.width()
or thumbnail.height() <= thumbSize.height():
67 thumbnail = thumbnail.scaled(thumbSize, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.FastTransformation)
69 thumbnail = thumbnail.scaled(thumbSize, Qt.AspectRatioMode.KeepAspectRatio, Qt.TransformationMode.SmoothTransformation)
72 self.modelReset.emit()