Skip to content

Commit

Permalink
Fix ValueError: height and width must be > 0
Browse files Browse the repository at this point in the history
  • Loading branch information
ali6parmak committed Oct 23, 2024
1 parent da45481 commit 5f85a05
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rapid_latex_ocr/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def minmax_size(
ratios = [a / b for a, b in zip(img.size, self.max_dims)]
if any([r > 1 for r in ratios]):
size = np.array(img.size) // max(ratios)
size = np.maximum(size, 1)
img = img.resize(tuple(size.astype(int)), Image.BILINEAR)

if self.min_dims is not None:
Expand Down

0 comments on commit 5f85a05

Please sign in to comment.