mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-09 16:25:33 +01:00
Add thumbnail export
This commit is contained in:
parent
1f145c6cba
commit
2e0e6bb8d2
2 changed files with 13 additions and 0 deletions
|
|
@ -62,7 +62,9 @@ class Command(Renderable, BaseCommand):
|
|||
document = document_map[document_dict["pk"]]
|
||||
|
||||
target = os.path.join(self.target, document.file_name)
|
||||
thumbnail_target = target + "-tumbnail.png"
|
||||
document_dict["__exported_file_name__"] = target
|
||||
document_dict["__exported_thumbnail_name__"] = thumbnail_target
|
||||
|
||||
print("Exporting: {}".format(target))
|
||||
|
||||
|
|
@ -71,6 +73,11 @@ class Command(Renderable, BaseCommand):
|
|||
t = int(time.mktime(document.created.timetuple()))
|
||||
os.utime(target, times=(t, t))
|
||||
|
||||
with open(thumbnail_target, "wb") as f:
|
||||
f.write(GnuPG.decrypted(document.thumbnail_file))
|
||||
t = int(time.mktime(document.created.timetuple()))
|
||||
os.utime(target, times=(t, t))
|
||||
|
||||
manifest += json.loads(
|
||||
serializers.serialize("json", Correspondent.objects.all()))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue