1 # This file is part of Librarian, licensed under GNU Affero GPLv3 or later.
2 # Copyright © Fundacja Wolne Lektury. See NOTICE for more information.
5 from librarian import get_resource
6 from .base import Widget
9 class ImageWidget(Widget):
10 def build(self, w, h):
11 img = PIL.Image.open(self.image_path)
12 img = img.resize((round(img.size[0] / img.size[1] * h), h))
16 class WLLogo(ImageWidget):
19 if self.cover.color_scheme['text'] == '#fff':
20 return get_resource('res/cover/logo_WL_invert.png')
22 return get_resource('res/cover/logo_WL.png')
25 class Label(ImageWidget):
28 if self.cover.is_very_bright:
29 return get_resource('res/cover/label_WLpolecaja.szary.png')
31 return get_resource('res/cover/label_WLpolecaja.png')