fix foto thumb size

This commit is contained in:
2022-04-13 12:39:23 +00:00
parent 0f3548b55e
commit a9a0729a73

View File

@@ -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}'.")