mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-10-18 13:58:12 +00:00
webp thumbnail support with png fallback
This commit is contained in:
1 parent
e4a26164de
commit
58f2c6a5fc
3 files changed
+15
-5
No files matched your search
@@ -293,11 +293,16 @@ class Document(models.Model):
|
||||
|
||||
@property
|
||||
def thumbnail_path(self):
|
||||
file_name = f"{self.pk:07}.png"
|
||||
file_name = f"{self.pk:07}.webp"
|
||||
if self.storage_type == self.STORAGE_TYPE_GPG:
|
||||
file_name += ".gpg"
|
||||
|
||||
return os.path.join(settings.THUMBNAIL_DIR, file_name)
|
||||
thumb = os.path.join(settings.THUMBNAIL_DIR, file_name)
|
||||
|
||||
if os.path.exists(thumb):
|
||||
return thumb
|
||||
else:
|
||||
return os.path.splitext(thumb)[0] + ".png"
|
||||
|
||||
@property
|
||||
def thumbnail_file(self):
|
||||
|
||||
Reference in new issue
Block a user