fix foto thumb size
This commit is contained in:
@@ -5,9 +5,10 @@ from PIL import Image, ExifTags, ImageOps
|
|||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
|
||||||
gallery_path = settings.GALLERY["path"]
|
gallery_path = settings.GALLERY["path"]
|
||||||
gallery_thumb_path = settings.GALLERY["thumb_path"]
|
gallery_thumb_path = settings.GALLERY["thumb_path"]
|
||||||
|
logger = logging.getLogger(__name__)
|
||||||
|
size = (320, 320)
|
||||||
valid_images = [".jpg", ".png"]
|
valid_images = [".jpg", ".png"]
|
||||||
|
|
||||||
|
|
||||||
@@ -88,6 +89,6 @@ def create_thumbs(folder_path):
|
|||||||
elif exif[orientation] == 8:
|
elif exif[orientation] == 8:
|
||||||
image = image.rotate(90, expand=True)
|
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)
|
thumb.save(thumb_file_path)
|
||||||
logger.info(f"Save thumb 'thumb_{f}'.")
|
logger.info(f"Save thumb 'thumb_{f}'.")
|
||||||
|
|||||||
Reference in New Issue
Block a user