mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-08 15:55:31 +01:00
The first stages of getting thumbnails back
This commit is contained in:
parent
5c41e717f0
commit
52f15b4de1
7 changed files with 135 additions and 5 deletions
|
|
@ -35,7 +35,7 @@ class FetchView(LoginRequiredMixin, DetailView):
|
|||
|
||||
def render_to_response(self, context, **response_kwargs):
|
||||
"""
|
||||
Override the default to return the unencrypted PDF as raw data.
|
||||
Override the default to return the unencrypted image/PDF as raw data.
|
||||
"""
|
||||
|
||||
content_types = {
|
||||
|
|
@ -46,6 +46,12 @@ class FetchView(LoginRequiredMixin, DetailView):
|
|||
Document.TYPE_TIF: "image/tiff",
|
||||
}
|
||||
|
||||
if self.kwargs["kind"] == "thumb":
|
||||
return HttpResponse(
|
||||
GnuPG.decrypted(self.object.thumb_file),
|
||||
content_type=content_types[Document.TYPE_JPG]
|
||||
)
|
||||
|
||||
response = HttpResponse(
|
||||
GnuPG.decrypted(self.object.source_file),
|
||||
content_type=content_types[self.object.file_type]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue