X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/8495b2ce8e9aebe778db74217b60fb68c0b5f9f2..77004f7537a472419bf9701c8522a774a0c29245:/src/librarian/covers/widgets/base.py?ds=inline diff --git a/src/librarian/covers/widgets/base.py b/src/librarian/covers/widgets/base.py index 15e4462..f28fc67 100644 --- a/src/librarian/covers/widgets/base.py +++ b/src/librarian/covers/widgets/base.py @@ -1,3 +1,6 @@ +# This file is part of Librarian, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Wolne Lektury. See NOTICE for more information. +# class Widget: transparency = True margin_top = 0 @@ -14,8 +17,9 @@ class Widget: def apply(self, img, x, y, w=None, h=None): my_img = self.build(w, h) - img.paste( - my_img, - (round(x), round(y - self.margin_top)), - my_img if self.transparency else None - ) + if my_img is not None: + img.paste( + my_img, + (round(x), round(y - self.margin_top)), + my_img if self.transparency else None + )