mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 18:06:18 +03:00
20 lines
594 B
Python
20 lines
594 B
Python
from PIL import Image
|
|
from helper import unittest, PillowTestCase
|
|
|
|
|
|
class TestJ2kEncodeOverflow(PillowTestCase):
|
|
def test_j2k_overflow(self):
|
|
|
|
im = Image.new('RGBA', (1024, 131584))
|
|
target = self.tempfile('temp.jpc')
|
|
try:
|
|
im.save(target)
|
|
self.assertTrue(False, "Expected IOError, save succeeded?")
|
|
except IOError as err:
|
|
self.assertTrue(True, "IOError is expected")
|
|
except Exception as err:
|
|
self.assertTrue(False, "Expected IOError, got %s" % type(err))
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|