From: Radek Czajka Date: Fri, 27 Jan 2012 18:39:05 +0000 (+0100) Subject: default cover X-Git-Tag: 1.7~170^2~2 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/d79767d890918b0dafe42095c372c3e98636891b?ds=inline default cover --- diff --git a/librarian/cover.py b/librarian/cover.py index 63e4aa0..0416628 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -192,6 +192,8 @@ class WLCover(Cover): bar_width = 35 background_color = '#444' author_color = '#444' + default_background = get_resource('res/background.jpg') + format = 'JPEG' epochs = { u'Starożytność': 0, @@ -217,6 +219,8 @@ class WLCover(Cover): bg_src = urlopen(book_info.cover_url) self.background_img = StringIO(bg_src.read()) bg_src.close() + else: + self.background_img = self.default_background def pretty_author(self): return self.author.upper() diff --git a/librarian/res/shaireproductions-4945819544-cc-by.jpg b/librarian/res/shaireproductions-4945819544-cc-by.jpg new file mode 100644 index 0000000..f2a19e3 Binary files /dev/null and b/librarian/res/shaireproductions-4945819544-cc-by.jpg differ diff --git a/scripts/book2cover b/scripts/book2cover index d2befc3..49cd539 100755 --- a/scripts/book2cover +++ b/scripts/book2cover @@ -33,7 +33,7 @@ if __name__ == '__main__': if options.verbose: print input_filename - output_filename = os.path.splitext(input_filename)[0] + '.png' + output_filename = os.path.splitext(input_filename)[0] + '.jpg' doc = WLDocument.from_file(input_filename) WLCover(doc.book_info).save(output_filename)