mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-06-06 22:23:16 +03:00
Fix chromaticity attribute in CmsProfile.
This commit is contained in:
parent
87603266ad
commit
31070a9165
|
@ -657,6 +657,30 @@ _profile_read_ciexyz(CmsProfileObject* self, cmsTagSignature info, int multi)
|
||||||
return _xyz_py(XYZ);
|
return _xyz_py(XYZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static PyObject*
|
||||||
|
_profile_read_ciexyy_triple(CmsProfileObject* self, cmsTagSignature info)
|
||||||
|
{
|
||||||
|
cmsCIExyYTRIPLE* triple;
|
||||||
|
|
||||||
|
if (!cmsIsTag(self->profile, info)) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
|
triple = (cmsCIExyYTRIPLE*) cmsReadTag(self->profile, info);
|
||||||
|
if (!triple) {
|
||||||
|
Py_INCREF(Py_None);
|
||||||
|
return Py_None;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Note: lcms does all the heavy lifting and error checking (nr of
|
||||||
|
channels == 3). */
|
||||||
|
return Py_BuildValue("((d,d,d),(d,d,d),(d,d,d)),",
|
||||||
|
triple->Red.x, triple->Red.y, triple->Red.Y,
|
||||||
|
triple->Green.x, triple->Green.y, triple->Green.Y,
|
||||||
|
triple->Blue.x, triple->Blue.y, triple->Blue.Y);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
_profile_read_named_color_list(CmsProfileObject* self, cmsTagSignature info)
|
_profile_read_named_color_list(CmsProfileObject* self, cmsTagSignature info)
|
||||||
{
|
{
|
||||||
|
@ -1138,7 +1162,7 @@ cms_profile_getattr_chromatic_adaptation(CmsProfileObject* self, void* closure)
|
||||||
static PyObject*
|
static PyObject*
|
||||||
cms_profile_getattr_chromaticity(CmsProfileObject* self, void* closure)
|
cms_profile_getattr_chromaticity(CmsProfileObject* self, void* closure)
|
||||||
{
|
{
|
||||||
return _profile_read_ciexyz(self, cmsSigChromaticityTag, 0);
|
return _profile_read_ciexyy_triple(self, cmsSigChromaticityTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PyObject*
|
static PyObject*
|
||||||
|
|
Loading…
Reference in New Issue
Block a user