mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 02:36:17 +03:00
patch : image copy
This commit is contained in:
parent
47ebf695ac
commit
8355a34c14
|
@ -190,7 +190,7 @@ def scale(image, factor, resample=Image.NEAREST):
|
||||||
:returns: An :py:class:`~PIL.Image.Image` object.
|
:returns: An :py:class:`~PIL.Image.Image` object.
|
||||||
"""
|
"""
|
||||||
if factor == 1:
|
if factor == 1:
|
||||||
return Image.Image._new(image.im)
|
return image.copy()
|
||||||
elif factor <= 0:
|
elif factor <= 0:
|
||||||
raise ValueError("the factor must be greater than 0")
|
raise ValueError("the factor must be greater than 0")
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user