diff --git a/fet2020/gallery/utils.py b/fet2020/gallery/utils.py index 466163df..35de7487 100644 --- a/fet2020/gallery/utils.py +++ b/fet2020/gallery/utils.py @@ -5,9 +5,10 @@ from PIL import Image, ExifTags, ImageOps from django.conf import settings -logger = logging.getLogger(__name__) gallery_path = settings.GALLERY["path"] gallery_thumb_path = settings.GALLERY["thumb_path"] +logger = logging.getLogger(__name__) +size = (320, 320) valid_images = [".jpg", ".png"] @@ -88,6 +89,6 @@ def create_thumbs(folder_path): elif exif[orientation] == 8: image = image.rotate(90, expand=True) - thumb = ImageOps.fit(image, (200, 200), Image.ANTIALIAS) + thumb = ImageOps.fit(image, size, Image.ANTIALIAS) thumb.save(thumb_file_path) logger.info(f"Save thumb 'thumb_{f}'.")