2016-03-26 14:25:28 +03:00
|
|
|
from PIL import Image
|
2019-01-13 20:00:12 +03:00
|
|
|
from .helper import unittest, PillowTestCase
|
2016-03-26 14:25:28 +03:00
|
|
|
|
2016-08-04 09:40:12 +03:00
|
|
|
|
2016-03-26 14:25:28 +03:00
|
|
|
class TestJ2kEncodeOverflow(PillowTestCase):
|
|
|
|
def test_j2k_overflow(self):
|
|
|
|
|
2019-06-13 18:53:42 +03:00
|
|
|
im = Image.new("RGBA", (1024, 131584))
|
|
|
|
target = self.tempfile("temp.jpc")
|
2016-11-06 19:58:45 +03:00
|
|
|
with self.assertRaises(IOError):
|
2016-03-26 14:25:28 +03:00
|
|
|
im.save(target)
|
|
|
|
|
2018-03-03 12:54:00 +03:00
|
|
|
|
2019-06-13 18:53:42 +03:00
|
|
|
if __name__ == "__main__":
|
2016-03-26 14:25:28 +03:00
|
|
|
unittest.main()
|