diff --git a/rapid_latex_ocr/utils.py b/rapid_latex_ocr/utils.py index 5e73509..cb07423 100644 --- a/rapid_latex_ocr/utils.py +++ b/rapid_latex_ocr/utils.py @@ -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: