mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-03 21:39:22 +00:00
The first stages of getting thumbnails back
This commit is contained in:
1 parent
5c41e717f0
commit
52f15b4de1
7 files changed
+135
-5
No files matched your search
@@ -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]
|
||||
|
||||
Reference in new issue
Block a user