mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-12 18:26:17 +03:00
Fixed array parameters to reflect new image resizing behavior
This commit is contained in:
parent
4889ae776c
commit
ca4ec0cea2
|
@ -11,7 +11,10 @@ except:
|
|||
|
||||
|
||||
class Test_scipy_resize(PillowTestCase):
|
||||
""" Tests for scipy regression in 2.6.0 """
|
||||
""" Tests for scipy regression in 2.6.0
|
||||
|
||||
Tests from https://github.com/scipy/scipy/blob/master/scipy/misc/pilutil.py
|
||||
"""
|
||||
|
||||
def setUp(self):
|
||||
if not HAS_SCIPY:
|
||||
|
@ -27,10 +30,10 @@ class Test_scipy_resize(PillowTestCase):
|
|||
def test_imresize4(self):
|
||||
im = np.array([[1,2],
|
||||
[3,4]])
|
||||
res = np.array([[ 1. , 1. , 1.5, 2. ],
|
||||
[ 1. , 1. , 1.5, 2. ],
|
||||
[ 2. , 2. , 2.5, 3. ],
|
||||
[ 3. , 3. , 3.5, 4. ]], dtype=np.float32)
|
||||
res = np.array([[ 1. , 1.25, 1.75, 2. ],
|
||||
[ 1.5 , 1.75, 2.25, 2.5 ],
|
||||
[ 2.5 , 2.75, 3.25, 3.5 ],
|
||||
[ 3. , 3.25, 3.75, 4. ]], dtype=np.float32)
|
||||
# Check that resizing by target size, float and int are the same
|
||||
im2 = misc.imresize(im, (4,4), mode='F') # output size
|
||||
im3 = misc.imresize(im, 2., mode='F') # fraction
|
||||
|
|
Loading…
Reference in New Issue
Block a user