mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-01 10:23:34 +03:00
Merge pull request #892 from radarhere/master
Avoid resize operation if image is already the correct size
This commit is contained in:
commit
dc1831d140
|
@ -1514,6 +1514,9 @@ class Image:
|
||||||
|
|
||||||
self.load()
|
self.load()
|
||||||
|
|
||||||
|
if self.size == size:
|
||||||
|
return self._new(self.im)
|
||||||
|
|
||||||
if self.mode in ("1", "P"):
|
if self.mode in ("1", "P"):
|
||||||
resample = NEAREST
|
resample = NEAREST
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user