Skip to content

Commit 4b4932d

Browse files
authored
Added a min size of 1 to avoid zero width/length in resize (#250)
1 parent 53ee321 commit 4b4932d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/cleanvision/issue_managers/image_property.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def calculate(self, image: Image) -> Dict[str, Union[float, str]]:
254254
ratio = max(image.width, image.height) / self.max_resolution
255255
if ratio > 1:
256256
resized_image = image.resize(
257-
(int(image.width // ratio), int(image.height // ratio))
257+
(max(int(image.width // ratio), 1), max(int(image.height // ratio), 1))
258258
)
259259
else:
260260
resized_image = image.copy()

0 commit comments

Comments
 (0)