X-Git-Url: https://git.mdrn.pl/librarian.git/blobdiff_plain/5bc29f19f308610c944d63597962fb3b0f468c54..6a2a1ba8ab5cad50af8dc0b1ec0387e4e4f41f4b:/librarian/styles/wolnelektury/cover.py diff --git a/librarian/styles/wolnelektury/cover.py b/librarian/styles/wolnelektury/cover.py index b417216..ce85d12 100644 --- a/librarian/styles/wolnelektury/cover.py +++ b/librarian/styles/wolnelektury/cover.py @@ -3,7 +3,7 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # -import Image, ImageFont, ImageDraw +from PIL import Image, ImageFont, ImageDraw from StringIO import StringIO from librarian import get_resource, URLOpener from librarian.cover import Cover, TextBox @@ -101,20 +101,17 @@ class WLCover(Cover): font=self.author_font, line_height=self.author_lineskip, color=self.author_color, - shadow_color=self.author_shadow, - ) + shadow_color=self.author_shadow) box.skip(10) - box.draw.line((75, box.height, 275, box.height), - fill=self.author_color, width=2) + box.draw.line((75, box.height, 275, box.height), fill=self.author_color, width=2) box.skip(15) box.text(self.pretty_title(), line_height=self.title_lineskip, font=self.title_font, color=epoch_color, - shadow_color=self.title_shadow, - ) + shadow_color=self.title_shadow) box_img = box.image() if self.kind == 'Liryka': @@ -127,9 +124,9 @@ class WLCover(Cover): # center box_top = (self.height - box_img.size[1]) / 2 - box_left = self.bar_width + (self.width - self.bar_width - - box_img.size[0]) / 2 - draw.rectangle((box_left, box_top, + box_left = self.bar_width + (self.width - self.bar_width - box_img.size[0]) / 2 + draw.rectangle(( + box_left, box_top, box_left + box_img.size[0], box_top + box_img.size[1]), fill='#fff') img.paste(box_img, (box_left, box_top), box_img)