Skip to content

Commit

Permalink
Added a min size of 1 to avoid zero width/length in resize (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjanag authored Feb 1, 2024
1 parent 53ee321 commit 4b4932d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cleanvision/issue_managers/image_property.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def calculate(self, image: Image) -> Dict[str, Union[float, str]]:
ratio = max(image.width, image.height) / self.max_resolution
if ratio > 1:
resized_image = image.resize(
(int(image.width // ratio), int(image.height // ratio))
(max(int(image.width // ratio), 1), max(int(image.height // ratio), 1))
)
else:
resized_image = image.copy()
Expand Down

0 comments on commit 4b4932d

Please sign in to comment.