fix: close pdf file object in thumb renderer (#893)

This commit is contained in:
Jann Stute
2025-03-31 01:36:04 +02:00
committed by GitHub
parent 1c02e75dd9
commit 33dd330c73

View File

@@ -910,6 +910,7 @@ class ThumbRenderer(QObject):
return im
document: QPdfDocument = QPdfDocument()
document.load(file)
file.close()
# Transform page_size in points to pixels with proper aspect ratio
page_size: QSizeF = document.pagePointSize(0)
ratio_hw: float = page_size.height() / page_size.width()