mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-13 05:06:49 +03:00
Merge pull request #2471 from radarhere/crop
Return copy on Image crop if crop dimensions match the image
This commit is contained in:
commit
df616d2b16
|
@ -1044,6 +1044,9 @@ class Image(object):
|
|||
|
||||
x0, y0, x1, y1 = map(int, map(round, box))
|
||||
|
||||
if x0 == 0 and y0 == 0 and (x1, y1) == self.size:
|
||||
return self.copy()
|
||||
|
||||
if x1 < x0:
|
||||
x1 = x0
|
||||
if y1 < y0:
|
||||
|
|
Loading…
Reference in New Issue
Block a user