Skip to content

Commit ede3470

Browse files
committed
Ensure all size parameters are integers to prevent type errors
1 parent b3c56b2 commit ede3470

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

library/utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,13 @@ def resize_image(image: np.ndarray, width: int, height: int, resized_width: int,
413413
Returns:
414414
image
415415
"""
416+
417+
# Ensure all size parameters are actual integers
418+
width = int(width)
419+
height = int(height)
420+
resized_width = int(resized_width)
421+
resized_height = int(resized_height)
422+
416423
if resize_interpolation is None:
417424
resize_interpolation = "lanczos" if width > resized_width and height > resized_height else "area"
418425

0 commit comments

Comments
 (0)