X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/e7d557155e2cd195f975e4559c353be5f28d7d66..25d92688ed2529ba82e0e3cf0017f25bae667297:/src/catalogue/views.py?ds=sidebyside diff --git a/src/catalogue/views.py b/src/catalogue/views.py index 99e3c8244..267d9b40a 100644 --- a/src/catalogue/views.py +++ b/src/catalogue/views.py @@ -785,3 +785,17 @@ def collections(request): 'objects': objects, 'best': best, }) + + +def ridero_cover(request, slug): + from librarian.cover import make_cover + wldoc = Book.objects.get(slug=slug).wldocument() + cover = make_cover(wldoc.book_info, width=980, bleed=20, format='PNG') + response = HttpResponse(content_type="image/png") + cover.save(response) + return response + + +def get_isbn(request, book_format, slug): + book = Book.objects.get(slug=slug) + return HttpResponse(book.extra_info.get('isbn_%s' % book_format))