Merge branch 'update-pymupdf-support' into 'master'

Update our code to support newer versions of PyMuPDF

See merge request openlp/openlp!277
This commit is contained in:
Raoul Snyman 2020-12-20 16:55:09 +00:00
commit 5fe3a43fe7
2 changed files with 4 additions and 3 deletions

View File

@ -1 +1 @@
2.9.1
2.9.0.dev340+90343cf3b

View File

@ -121,8 +121,9 @@ class PdfDocument(PresentationDocument):
src_size = page.bound().round()
# keep aspect ratio
scale = min(size.width() / src_size.width, size.height() / src_size.height)
m = fitz.Matrix(scale, scale)
page.getPixmap(m, alpha=False).writeImage(str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
matrix = fitz.Matrix(scale, scale)
page.getPixmap(matrix=matrix, alpha=False).writeImage(
str(temp_dir_path / 'mainslide{:03d}.png'.format(i)))
pdf.close()
created_files = sorted(temp_dir_path.glob('*'))
for image_path in created_files: