Skip to content

Commit

Permalink
expose ImageCms.core.CmsTransform
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Jan 20, 2024
1 parent 1bfa30a commit 1e8e186
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/test_imagecms.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,14 @@ def test_profile_typesafety():
ImageCms.core.CmsProfile(0)


def test_transform_typesafety():
# core transform should not be directly instantiable
with pytest.raises(TypeError):
ImageCms.core.CmsProfile()
with pytest.raises(TypeError):
ImageCms.core.CmsProfile(0)


def assert_aux_channel_preserved(mode, transform_in_place, preserved_channel):
def create_test_image():
# set up test image with something interesting in the tested aux channel.
Expand Down
3 changes: 3 additions & 0 deletions src/_imagingcms.c
Original file line number Diff line number Diff line change
Expand Up @@ -1518,6 +1518,9 @@ setup_module(PyObject *m) {
Py_INCREF(&CmsProfile_Type);
PyModule_AddObject(m, "CmsProfile", (PyObject *)&CmsProfile_Type);

Py_INCREF(&CmsTransform_Type);
PyModule_AddObject(m, "CmsTransform", (PyObject *)&CmsTransform_Type);

d = PyModule_GetDict(m);

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

0 comments on commit 1e8e186

Please sign in to comment.