diff --git a/__init__.py b/__init__.py index c4aef05..0706783 100644 --- a/__init__.py +++ b/__init__.py @@ -385,7 +385,11 @@ async def get_model_preview(request): crop_box = (0, y0, w0, y0 + int(crop_height_fp)) image = image.crop(crop_box) - image.thumbnail((w, h)) + if w < w0 and h < h0: + resampling_method = Image.Resampling.BOX + else: + resampling_method = Image.Resampling.BICUBIC + image.thumbnail((w, h), resample=resampling_method) if not image_format_is_equal(image_format, response_image_format) and (response_image_format == 'JPEG' or response_image_format == 'JPG'): image = image.convert('RGB') diff --git a/web/model-manager.css b/web/model-manager.css index 420d5d7..f2afa0b 100644 --- a/web/model-manager.css +++ b/web/model-manager.css @@ -322,8 +322,8 @@ /* preview image */ .model-manager .item { position: relative; - width: 230px; - height: 345px; + width: 240px; + height: 360px; text-align: center; overflow: hidden; border-radius: 8px;