mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Merge pull request #1659 from jmoraleda/pdfviewer_alpha_fix
Explicitly indicate that we don't want an alpha channel when rendering pdf image
This commit is contained in:
@@ -515,11 +515,8 @@ class mupdfProcessor(object):
|
||||
page = self.pdfdoc.loadPage(pageno)
|
||||
matrix = fitz.Matrix(scale, scale)
|
||||
try:
|
||||
pix = page.getPixmap(matrix=matrix) # MUST be keyword arg(s)
|
||||
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)
|
||||
pix = page.getPixmap(matrix=matrix, alpha=False) # MUST be keyword arg(s)
|
||||
bmp = wx.Bitmap.FromBuffer(pix.width, pix.height, pix.samples)
|
||||
gc.DrawBitmap(bmp, 0, 0, pix.width, pix.height)
|
||||
self.zoom_error = False
|
||||
except (RuntimeError, MemoryError):
|
||||
|
||||
Reference in New Issue
Block a user