mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 19:06:18 +03:00
Merge pull request #2211 from radarhere/paste
Changed behaviour of default box argument for paste method to match docs
This commit is contained in:
commit
318e8d9ed5
|
@ -1307,8 +1307,7 @@ class Image(object):
|
|||
box = None
|
||||
|
||||
if box is None:
|
||||
# cover all of self
|
||||
box = (0, 0) + self.size
|
||||
box = (0, 0)
|
||||
|
||||
if len(box) == 2:
|
||||
# upper left corner given; get size from image or mask
|
||||
|
@ -1321,7 +1320,7 @@ class Image(object):
|
|||
raise ValueError(
|
||||
"cannot determine region size; use 4-item box"
|
||||
)
|
||||
box = box + (box[0]+size[0], box[1]+size[1])
|
||||
box += (box[0]+size[0], box[1]+size[1])
|
||||
|
||||
if isStringType(im):
|
||||
from PIL import ImageColor
|
||||
|
|
|
@ -251,6 +251,13 @@ class TestImagingPaste(PillowTestCase):
|
|||
(126, 63, 255, 63)
|
||||
])
|
||||
|
||||
def test_different_sizes(self):
|
||||
im = Image.new('RGB', (100, 100))
|
||||
im2 = Image.new('RGB', (50, 50))
|
||||
|
||||
im.copy().paste(im2)
|
||||
im.copy().paste(im2, (0,0))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Reference in New Issue
Block a user