diff --git a/Tests/test_image_resize.py b/Tests/test_image_resize.py index f8c9bf1a1..2f0546391 100644 --- a/Tests/test_image_resize.py +++ b/Tests/test_image_resize.py @@ -292,8 +292,11 @@ class TestImageResize: def resize_scale(mode: str, scale: float) -> None: img = hopper(mode) - size = (int(self.width * scale), int(self.height * scale)) - out = img.resize(scale=scale) + size = ( + int(self.width * scale), + int(self.height * scale) + ) + out = img.resize(img.size, scale=scale) assert out.mode == mode assert out.size == tuple(size) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index bd1151b6c..2da1fcc44 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -2230,8 +2230,8 @@ class Image: :param size: The requested size in pixels, as a tuple or array: (width, height). :param scale: An optional scale factor to upsample/downsample the image: - (e.g. 0.5 means that an image (width, height) will be - resized to (width/2, height/2)). If provided overwrite size. + (e.g. 0.5 means that an image input size will be + resized to (size[0]/2, size[1]/2)). :param resample: An optional resampling filter. This can be one of :py:data:`Resampling.NEAREST`, :py:data:`Resampling.BOX`, :py:data:`Resampling.BILINEAR`, :py:data:`Resampling.HAMMING`, @@ -2292,7 +2292,10 @@ class Image: raise ValueError(msg) if scale: - size = (int(self.width * scale), int(self.height * scale)) + size = ( + int(size[0] * scale), + int(size[1] * scale) + ) self.load() if box is None: