From 78019981243f09ee27ea48994773eb2e4414cff6 Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Mon, 7 Aug 2017 15:27:58 +0200 Subject: [PATCH 1/1] add option to select cover class in metadata --- lib/librarian | 2 +- src/catalogue/management/commands/gencover.py | 4 ++-- src/catalogue/views.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/librarian b/lib/librarian index c87453a1d..40110cdb9 160000 --- a/lib/librarian +++ b/lib/librarian @@ -1 +1 @@ -Subproject commit c87453a1da79443d74132398e7dd1aaa83140fee +Subproject commit 40110cdb916b003da032cb350fad27bd22f64602 diff --git a/src/catalogue/management/commands/gencover.py b/src/catalogue/management/commands/gencover.py index d4c838351..5afd1ba24 100644 --- a/src/catalogue/management/commands/gencover.py +++ b/src/catalogue/management/commands/gencover.py @@ -5,7 +5,7 @@ from django.core.management.base import BaseCommand from catalogue.models import Book -from librarian.cover import DefaultEbookCover +from librarian.cover import make_cover class Command(BaseCommand): @@ -19,5 +19,5 @@ class Command(BaseCommand): size = options['size'] bleed = 20 if options['bleed'] else 0 wldoc = Book.objects.get(slug=slug).wldocument() - cover = DefaultEbookCover(wldoc.book_info, width=size, bleed=bleed) + cover = make_cover(wldoc.book_info, width=size, bleed=bleed) cover.save('%s.jpg' % slug) diff --git a/src/catalogue/views.py b/src/catalogue/views.py index fd98dee23..267d9b40a 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -788,9 +788,9 @@ def collections(request): def ridero_cover(request, slug): - from librarian.cover import DefaultEbookCover + from librarian.cover import make_cover wldoc = Book.objects.get(slug=slug).wldocument() - cover = DefaultEbookCover(wldoc.book_info, width=980, bleed=20, format='PNG') + cover = make_cover(wldoc.book_info, width=980, bleed=20, format='PNG') response = HttpResponse(content_type="image/png") cover.save(response) return response -- 2.20.1