judge image size for using diff interpolation

This commit is contained in:
sdbds
2024-07-12 22:56:38 +08:00
parent 25f961bc77
commit 87526942a6

View File

@@ -2362,7 +2362,7 @@ def trim_and_resize_if_required(
if image_width != resized_size[0] or image_height != resized_size[1]:
# リサイズする
image = cv2.resize(image, resized_size, interpolation=cv2.INTER_AREA) # INTER_AREAでやりたいのでcv2でリサイズ
image = cv2.resize(image, resized_size, interpolation=cv2.INTER_AREA if image_width > resized_size[0] and image_height > resized_size[1] else cv2.INTER_LANCZOS4)
image_height, image_width = image.shape[0:2]