From a957f546b133e1f35661e7ae477183f23e2101f3 Mon Sep 17 00:00:00 2001 From: uraid Date: Tue, 7 Sep 2021 10:53:08 +0300 Subject: [PATCH] Fix crashes in thumbnails generation --- photonix/photos/utils/thumbnails.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/photonix/photos/utils/thumbnails.py b/photonix/photos/utils/thumbnails.py index acd16b5d..19b2eea7 100644 --- a/photonix/photos/utils/thumbnails.py +++ b/photonix/photos/utils/thumbnails.py @@ -4,7 +4,7 @@ import math from pathlib import Path -from PIL import Image, ImageOps +from PIL import Image, ImageOps, ImageFile import numpy as np from django.conf import settings @@ -82,6 +82,7 @@ def get_thumbnail(photo_file=None, photo=None, width=256, height=256, crop='cove # Read base image and metadata input_path = photo_file.base_image_path + ImageFile.LOAD_TRUNCATED_IMAGES = True im = Image.open(input_path) if im.mode != 'RGB':