small cleanup

This commit is contained in:
LunarEclipse 2024-04-28 16:52:13 +02:00
parent 8c8a01f1f1
commit ba660af9eb
1 changed files with 1 additions and 6 deletions

View File

@ -13,8 +13,6 @@ import cairo
import fitz
TEST_FILENAME = "/home/luna/Documents/Resources/Praca Licencjacka/sources/2018_Torres-Benitez_Metabolomic analysis Parmotrema.pdf"
Coords: TypeAlias = Tuple[float, float]
@ -31,10 +29,6 @@ class Document:
self.selections: Dict[int, List[Selection]] = {}
class State():
pass
class PdfPage(Gtk.DrawingArea):
def __init__(self, page, *args, **kwargs):
super().__init__(*args, **kwargs)
@ -52,6 +46,7 @@ class PdfPage(Gtk.DrawingArea):
sctx = widget.get_style_context()
Gtk.render_background(sctx, cr, 0, 0, width, height)
pix = self.page.get_pixmap(dpi=96) # type: ignore
img = PIL.Image.frombytes("RGBA" if pix.alpha else "RGB", [pix.width, pix.height], pix.samples)
img.putalpha(1)