mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Return after error
This commit is contained in:
parent
1c57a41ece
commit
2995fb67c1
|
@ -90,6 +90,12 @@ class TestFileJpeg2k(PillowTestCase):
|
|||
)
|
||||
self.assert_image_equal(im, test_card)
|
||||
|
||||
def test_tiled_offset_too_small(self):
|
||||
with self.assertRaises(ValueError):
|
||||
self.roundtrip(
|
||||
test_card, tile_size=(128, 128), tile_offset=(0, 0), offset=(128, 32)
|
||||
)
|
||||
|
||||
def test_irreversible_rt(self):
|
||||
im = self.roundtrip(test_card, irreversible=True, quality_layers=[20])
|
||||
self.assert_image_similar(im, test_card, 2.0)
|
||||
|
|
|
@ -1211,6 +1211,8 @@ PyImaging_Jpeg2KEncoderNew(PyObject *self, PyObject *args)
|
|||
PyErr_SetString(PyExc_ValueError,
|
||||
"JPEG 2000 tile offset too small; top left tile must "
|
||||
"intersect image area");
|
||||
Py_DECREF(encoder);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (context->tile_offset_x > context->offset_x
|
||||
|
|
Loading…
Reference in New Issue
Block a user