mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-09 08:00:49 +03:00
Merge pull request #1063 from wiredfool/scipy-test
Fixed array parameters to reflect new image resizing behavior
This commit is contained in:
commit
36450368b4
|
@ -11,7 +11,10 @@ except:
|
||||||
|
|
||||||
|
|
||||||
class Test_scipy_resize(PillowTestCase):
|
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):
|
def setUp(self):
|
||||||
if not HAS_SCIPY:
|
if not HAS_SCIPY:
|
||||||
|
@ -27,10 +30,10 @@ class Test_scipy_resize(PillowTestCase):
|
||||||
def test_imresize4(self):
|
def test_imresize4(self):
|
||||||
im = np.array([[1,2],
|
im = np.array([[1,2],
|
||||||
[3,4]])
|
[3,4]])
|
||||||
res = np.array([[ 1. , 1. , 1.5, 2. ],
|
res = np.array([[ 1. , 1.25, 1.75, 2. ],
|
||||||
[ 1. , 1. , 1.5, 2. ],
|
[ 1.5 , 1.75, 2.25, 2.5 ],
|
||||||
[ 2. , 2. , 2.5, 3. ],
|
[ 2.5 , 2.75, 3.25, 3.5 ],
|
||||||
[ 3. , 3. , 3.5, 4. ]], dtype=np.float32)
|
[ 3. , 3.25, 3.75, 4. ]], dtype=np.float32)
|
||||||
# Check that resizing by target size, float and int are the same
|
# Check that resizing by target size, float and int are the same
|
||||||
im2 = misc.imresize(im, (4,4), mode='F') # output size
|
im2 = misc.imresize(im, (4,4), mode='F') # output size
|
||||||
im3 = misc.imresize(im, 2., mode='F') # fraction
|
im3 = misc.imresize(im, 2., mode='F') # fraction
|
||||||
|
|
Loading…
Reference in New Issue
Block a user