Skip to content

Commit f18ccdd

Browse files
authored
Merge pull request #342 from uraid/fix-thumbnail-generating
Fix crashes in thumbnails generation
2 parents 4881777 + a957f54 commit f18ccdd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

photonix/photos/utils/thumbnails.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import math
55
from pathlib import Path
66

7-
from PIL import Image, ImageOps
7+
from PIL import Image, ImageOps, ImageFile
88
import numpy as np
99

1010
from django.conf import settings
@@ -82,6 +82,7 @@ def get_thumbnail(photo_file=None, photo=None, width=256, height=256, crop='cove
8282

8383
# Read base image and metadata
8484
input_path = photo_file.base_image_path
85+
ImageFile.LOAD_TRUNCATED_IMAGES = True
8586
im = Image.open(input_path)
8687

8788
if im.mode != 'RGB':

0 commit comments

Comments
 (0)