Skip to content

Commit

Permalink
Merge pull request #342 from uraid/fix-thumbnail-generating
Browse files Browse the repository at this point in the history
Fix crashes in thumbnails generation
  • Loading branch information
damianmoore committed Oct 25, 2021
2 parents 4881777 + a957f54 commit f18ccdd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion photonix/photos/utils/thumbnails.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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':
Expand Down

0 comments on commit f18ccdd

Please sign in to comment.