mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-20 21:41:02 +03:00
test for #1711
This commit is contained in:
parent
41fae6d9e2
commit
c8f70e19e1
18
Tests/test_image_resample.py
Normal file
18
Tests/test_image_resample.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
from helper import unittest, PillowTestCase, hopper
|
||||||
|
from PIL import Image
|
||||||
|
|
||||||
|
class TestImagingCoreResize(PillowTestCase):
|
||||||
|
#see https://github.com/python-pillow/Pillow/issues/1710
|
||||||
|
def test_overflow(self):
|
||||||
|
im = hopper('L')
|
||||||
|
xsize = 0x100000008 // 4
|
||||||
|
ysize = 1000 # unimportant
|
||||||
|
try:
|
||||||
|
im.im.resize((xsize, ysize), Image.LINEAR) # any resampling filter will do here
|
||||||
|
self.fail("Resize should raise MemoryError on invalid xsize")
|
||||||
|
except MemoryError:
|
||||||
|
self.assertTrue(True, "Should raise MemoryError")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
unittest.main()
|
Loading…
Reference in New Issue
Block a user