Update CSS and JavaScript to match preview ratio (3/2).
- Changed thumbnail resampling method to `BOX` when downscaling preview.
This commit is contained in:
@@ -385,7 +385,11 @@ async def get_model_preview(request):
|
|||||||
crop_box = (0, y0, w0, y0 + int(crop_height_fp))
|
crop_box = (0, y0, w0, y0 + int(crop_height_fp))
|
||||||
image = image.crop(crop_box)
|
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'):
|
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')
|
image = image.convert('RGB')
|
||||||
|
|||||||
@@ -322,8 +322,8 @@
|
|||||||
/* preview image */
|
/* preview image */
|
||||||
.model-manager .item {
|
.model-manager .item {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 230px;
|
width: 240px;
|
||||||
height: 345px;
|
height: 360px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
|
|||||||
Reference in New Issue
Block a user