X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/652e2d66d7f88cc6b857edc4aaac7e14a654eb36..ba3781854f976685312775d71c29a9b1a5426709:/src/catalogue/views.py?ds=sidebyside diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 99e3c8244..503b6f533 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -785,3 +785,12 @@ def collections(request): 'objects': objects, 'best': best, }) + + +def ridero_cover(request, slug): + from librarian.cover import DefaultEbookCover + wldoc = Book.objects.get(slug=slug).wldocument() + cover = DefaultEbookCover(wldoc.book_info, width=980, bleed=20, format='PNG') + response = HttpResponse(content_type="image/png") + cover.save(response) + return response