mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Py3. sigh
This commit is contained in:
parent
46c58560ba
commit
7546e1fb17
|
@ -7,7 +7,7 @@ def test_extent():
|
|||
(w,h) = im.size
|
||||
transformed = im.transform(im.size, Image.EXTENT,
|
||||
(0,0,
|
||||
w/2,h/2), # ul -> lr
|
||||
w//2,h//2), # ul -> lr
|
||||
Image.BILINEAR)
|
||||
|
||||
|
||||
|
@ -20,8 +20,8 @@ def test_quad():
|
|||
im = lena('RGB')
|
||||
(w,h) = im.size
|
||||
transformed = im.transform(im.size, Image.QUAD,
|
||||
(0,0,0,h/2,
|
||||
w/2,h/2,w/2,0), # ul -> ccw around quad
|
||||
(0,0,0,h//2,
|
||||
w//2,h//2,w//2,0), # ul -> ccw around quad
|
||||
Image.BILINEAR)
|
||||
|
||||
scaled = im.resize((w*2, h*2), Image.BILINEAR).crop((0,0,w,h))
|
||||
|
@ -33,29 +33,29 @@ def test_mesh():
|
|||
im = lena('RGBA')
|
||||
(w,h) = im.size
|
||||
transformed = im.transform(im.size, Image.MESH,
|
||||
[((0,0,w/2,h/2), # box
|
||||
[((0,0,w//2,h//2), # box
|
||||
(0,0,0,h,
|
||||
w,h,w,0)), # ul -> ccw around quad
|
||||
((w/2,h/2,w,h), # box
|
||||
((w//2,h//2,w,h), # box
|
||||
(0,0,0,h,
|
||||
w,h,w,0))], # ul -> ccw around quad
|
||||
Image.BILINEAR)
|
||||
|
||||
transformed.save('transformed.png')
|
||||
|
||||
scaled = im.resize((w/2, h/2), Image.BILINEAR)
|
||||
scaled = im.resize((w//2, h//2), Image.BILINEAR)
|
||||
|
||||
checker = Image.new('RGBA', im.size)
|
||||
checker.paste(scaled, (0,0))
|
||||
checker.paste(scaled, (w/2,h/2))
|
||||
checker.paste(scaled, (w//2,h//2))
|
||||
|
||||
assert_image_equal(transformed, checker)
|
||||
|
||||
# now, check to see that the extra area is (0,0,0,0)
|
||||
blank = Image.new('RGBA', (w/2,h/2), (0,0,0,0))
|
||||
blank = Image.new('RGBA', (w//2,h//2), (0,0,0,0))
|
||||
|
||||
assert_image_equal(blank, transformed.crop((w/2,0,w,h/2)))
|
||||
assert_image_equal(blank, transformed.crop((0,h/2,w/2,h)))
|
||||
assert_image_equal(blank, transformed.crop((w//2,0,w,h//2)))
|
||||
assert_image_equal(blank, transformed.crop((0,h//2,w//2,h)))
|
||||
|
||||
|
||||
def test_blank_fill():
|
||||
|
|
Loading…
Reference in New Issue
Block a user