diff --git a/api/onnx_web/chain/reduce_thumbnail.py b/api/onnx_web/chain/reduce_thumbnail.py index 50cccc1d..9114c289 100644 --- a/api/onnx_web/chain/reduce_thumbnail.py +++ b/api/onnx_web/chain/reduce_thumbnail.py @@ -20,6 +20,9 @@ def reduce_thumbnail( **kwargs, ) -> Image.Image: image = source_image.copy() + + # TODO: should use a call to valid_image image = image.thumbnail((size.width, size.height)) + logger.info("created thumbnail with dimensions: %sx%s", image.width, image.height) return image diff --git a/api/onnx_web/params.py b/api/onnx_web/params.py index 1a645056..4a744138 100644 --- a/api/onnx_web/params.py +++ b/api/onnx_web/params.py @@ -54,6 +54,9 @@ class Size: self.width = width self.height = height + def __iter__(self): + return iter([self.width, self.height]) + def __str__(self) -> str: return "%sx%s" % (self.width, self.height)