mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Entirely removes the optipng, updates ghostscript fall back to also use WebP. Updates the conversion to use a multiprocessing pool
This commit is contained in:
@@ -308,17 +308,11 @@ class Document(models.Model):
|
||||
png_file_path = os.path.join(settings.THUMBNAIL_DIR, png_file_name)
|
||||
|
||||
# 1. Assume the thumbnail is WebP
|
||||
if not os.path.exists(webp_file_path):
|
||||
# 2. If WebP doesn't exist, check PNG
|
||||
if not os.path.exists(png_file_path):
|
||||
# 3. If PNG doesn't exist, filename is being constructed, return WebP
|
||||
thumb = webp_file_path
|
||||
else:
|
||||
# 2.1 - PNG file exists, return path to it
|
||||
thumb = png_file_path
|
||||
if os.path.exists(png_file_path):
|
||||
thumb = png_file_path
|
||||
else:
|
||||
# 1.1 - WebP file exists, return path to it
|
||||
thumb = webp_file_path
|
||||
|
||||
return os.path.normpath(thumb)
|
||||
|
||||
@property
|
||||
|
Reference in New Issue
Block a user