mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-04 19:10:09 +01:00
Merge pull request #1516 from jmoraleda/bugfix1350
Fixes pdfviewer when using PyMuPDF version 1.15 or above. Fixes #1350
This commit is contained in:
@@ -516,7 +516,10 @@ class mupdfProcessor(object):
|
||||
matrix = fitz.Matrix(scale, scale)
|
||||
try:
|
||||
pix = page.getPixmap(matrix=matrix) # MUST be keyword arg(s)
|
||||
bmp = wx.Bitmap.FromBufferRGBA(pix.width, pix.height, pix.samples)
|
||||
if [int(v) for v in fitz.version[1].split('.')] >= [1,15,0]:
|
||||
bmp = wx.Bitmap.FromBuffer(pix.width, pix.height, pix.samples)
|
||||
else:
|
||||
bmp = wx.Bitmap.FromBufferRGBA(pix.width, pix.height, pix.samples)
|
||||
gc.DrawBitmap(bmp, 0, 0, pix.width, pix.height)
|
||||
self.zoom_error = False
|
||||
except (RuntimeError, MemoryError):
|
||||
@@ -1075,4 +1078,3 @@ class pdfPrintout(wx.Printout):
|
||||
|
||||
self.view.pdfdoc.RenderPage(gc, pageno, sfac)
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user