Skip to content

Commit 0015e9c

Browse files
committed
expose ImageCms.core.CmsTransform
1 parent 047a0d2 commit 0015e9c

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

Tests/test_imagecms.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,15 @@ def test_profile_typesafety() -> None:
522522
ImageCms.core.CmsProfile(0)
523523

524524

525+
@pytest.mark.skipif(is_pypy(), reason="fails on PyPy")
526+
def test_transform_typesafety() -> None:
527+
# core transform should not be directly instantiable
528+
with pytest.raises(TypeError):
529+
ImageCms.core.CmsProfile()
530+
with pytest.raises(TypeError):
531+
ImageCms.core.CmsProfile(0)
532+
533+
525534
def assert_aux_channel_preserved(
526535
mode: str, transform_in_place: bool, preserved_channel: str
527536
) -> None:

src/_imagingcms.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1518,6 +1518,9 @@ setup_module(PyObject *m) {
15181518
Py_INCREF(&CmsProfile_Type);
15191519
PyModule_AddObject(m, "CmsProfile", (PyObject *)&CmsProfile_Type);
15201520

1521+
Py_INCREF(&CmsTransform_Type);
1522+
PyModule_AddObject(m, "CmsTransform", (PyObject *)&CmsTransform_Type);
1523+
15211524
d = PyModule_GetDict(m);
15221525

15231526
/* this check is also in PIL.features.pilinfo() */

0 commit comments

Comments
 (0)