minor changes - code style, default zoom
This commit is contained in:
parent
e124669185
commit
25c89fd5d5
|
@ -43,7 +43,7 @@ class PdfPage(Gtk.DrawingArea):
|
|||
super().__init__(*args, **kwargs)
|
||||
|
||||
self.page: Page = page
|
||||
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=96) # type: ignore
|
||||
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=50) # type: ignore
|
||||
self.set_size_request(pix.width, pix.height)
|
||||
self.connect("draw", self.on_draw, {})
|
||||
|
||||
|
@ -60,7 +60,7 @@ class PdfPage(Gtk.DrawingArea):
|
|||
sctx = widget.get_style_context()
|
||||
Gtk.render_background(sctx, cr, 0, 0, width, height)
|
||||
|
||||
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=96) # type: ignore
|
||||
pix: fitz.Pixmap = self.page.raw.get_pixmap(dpi=50) # type: ignore
|
||||
img = PIL.Image.frombytes("RGBA" if pix.alpha else "RGB", [pix.width, pix.height], pix.samples)
|
||||
img.putalpha(1)
|
||||
img = PIL.Image.merge("RGBA", (lambda r, g, b, a: (b, g, r, a))(*img.split())) # type: ignore
|
||||
|
|
Loading…
Reference in New Issue