From c373c498d9276b54ea6d583bd16b175aeadab1fb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 18 Aug 2024 15:46:30 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Tests/test_image_resize.py | 5 +---- src/PIL/Image.py | 7 ++----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/Tests/test_image_resize.py b/Tests/test_image_resize.py index b278c841d..f8c9bf1a1 100644 --- a/Tests/test_image_resize.py +++ b/Tests/test_image_resize.py @@ -292,10 +292,7 @@ class TestImageResize: def resize_scale(mode: str, scale: float) -> None: img = hopper(mode) - size = ( - int(self.width * scale), - int(self.height * scale) - ) + size = (int(self.width * scale), int(self.height * scale)) out = img.resize(scale=scale) assert out.mode == mode assert out.size == tuple(size) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 043a5e952..bd1151b6c 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2290,12 +2290,9 @@ class Image: if reducing_gap is not None and reducing_gap < 1.0: msg = "reducing_gap must be 1.0 or greater" raise ValueError(msg) - + if scale: - size = ( - int(self.width * scale), - int(self.height * scale) - ) + size = (int(self.width * scale), int(self.height * scale)) self.load() if box is None: