2023-12-21 14:13:31 +03:00
|
|
|
from __future__ import annotations
|
2024-01-20 14:23:03 +03:00
|
|
|
|
2024-01-23 13:42:36 +03:00
|
|
|
from pathlib import Path
|
2024-01-21 06:38:17 +03:00
|
|
|
|
2020-03-28 04:51:28 +03:00
|
|
|
import pytest
|
2020-08-07 13:28:33 +03:00
|
|
|
|
2016-03-26 14:25:28 +03:00
|
|
|
from PIL import Image
|
2019-07-06 23:40:53 +03:00
|
|
|
|
2018-03-03 12:54:00 +03:00
|
|
|
|
2024-01-23 13:42:36 +03:00
|
|
|
def test_j2k_overflow(tmp_path: Path) -> None:
|
2020-03-28 04:51:28 +03:00
|
|
|
im = Image.new("RGBA", (1024, 131584))
|
|
|
|
target = str(tmp_path / "temp.jpc")
|
2020-04-07 09:58:21 +03:00
|
|
|
with pytest.raises(OSError):
|
2020-03-28 04:51:28 +03:00
|
|
|
im.save(target)
|