except:
return HttpResponseRedirect(os.path.join(settings.STATIC_URL, "img/sample_cover.png"))
cover = DefaultEbookCover(info)
except:
return HttpResponseRedirect(os.path.join(settings.STATIC_URL, "img/sample_cover.png"))
cover = DefaultEbookCover(info)
image = cover.image().resize(PREVIEW_SIZE, Image.ANTIALIAS)
image.save(response, cover.format)
return response
image = cover.image().resize(PREVIEW_SIZE, Image.ANTIALIAS)
image.save(response, cover.format)
return response
return render(request, "cover/image_list.html", {
'object_list': Image.objects.all(),
'can_add': request.user.has_perm('cover.add_image'),
return render(request, "cover/image_list.html", {
'object_list': Image.objects.all(),
'can_add': request.user.has_perm('cover.add_image'),