From db4f11a05c6f6d9069923d241f4a7558b04f9ea9 Mon Sep 17 00:00:00 2001 From: wiredfool Date: Tue, 1 Oct 2013 22:16:59 -0700 Subject: [PATCH] DWORD -> cmsUInt32Number --- _imagingcms.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/_imagingcms.c b/_imagingcms.c index 390290298..1c85523ac 100644 --- a/_imagingcms.c +++ b/_imagingcms.c @@ -392,30 +392,34 @@ createProfile(PyObject *self, PyObject *args) { char *sColorSpace; cmsHPROFILE hProfile; - int iColorTemp = 0; - LPcmsCIExyY whitePoint = NULL; - LCMSBOOL result; + cmsFloat64Number dColorTemp = 0.0; + cmsCIExyY *whitePoint = NULL; + cmsBool result; - if (!PyArg_ParseTuple(args, "s|i:createProfile", &sColorSpace, &iColorTemp)) + if (!PyArg_ParseTuple(args, "s|d:createProfile", &sColorSpace, &dColorTemp)) return NULL; if (strcmp(sColorSpace, "LAB") == 0) { - if (iColorTemp > 0) { - result = cmsWhitePointFromTemp(iColorTemp, whitePoint); + if (dColorTemp > 0.0) { + result = cmsWhitePointFromTemp(whitePoint, dColorTemp); if (!result) { - PyErr_SetString(PyExc_ValueError, "ERROR: Could not calculate white point from color temperature provided, must be integer in degrees Kelvin"); + PyErr_SetString(PyExc_ValueError, "ERROR: Could not calculate white point from color temperature provided, must be float in degrees Kelvin"); return NULL; } hProfile = cmsCreateLabProfile(whitePoint); - } else + } else { hProfile = cmsCreateLabProfile(NULL); + } } - else if (strcmp(sColorSpace, "XYZ") == 0) + else if (strcmp(sColorSpace, "XYZ") == 0) { hProfile = cmsCreateXYZProfile(); - else if (strcmp(sColorSpace, "sRGB") == 0) + } + else if (strcmp(sColorSpace, "sRGB") == 0) { hProfile = cmsCreate_sRGBProfile(); - else + } + else { hProfile = NULL; + } if (!hProfile) { PyErr_SetString(PyExc_ValueError, "failed to create requested color space");