From ce4671c14cae421068eb737a1f10a1c2e01fbffe Mon Sep 17 00:00:00 2001 From: wiredfool Date: Wed, 2 Oct 2013 16:35:07 -0700 Subject: [PATCH] better white point calculation, but still questionable --- _imagingcms.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_imagingcms.c b/_imagingcms.c index cb30503e9..5bea640fe 100644 --- a/_imagingcms.c +++ b/_imagingcms.c @@ -570,13 +570,14 @@ cms_profile_getattr_product_info(CmsProfileObject* self, void* closure) _info_concat(&ret, description); _info_concat(&ret, copyright); -#define K007 (icTagSignature)0x4B303037 if (cmsIsTag(self->profile, cmsSigMediaWhitePointTag)){ - cmsCIExyY *WhitePt; + cmsCIEXYZ *WhitePt; + cmsCIExyY xyyWhitePt; cmsFloat64Number tempK; - WhitePt = (cmsCIExyY *) cmsReadTag(self->profile, cmsSigMediaWhitePointTag); - if (cmsTempFromWhitePoint(&tempK, WhitePt)){ + WhitePt = (cmsCIEXYZ *) cmsReadTag(self->profile, cmsSigMediaWhitePointTag); + cmsXYZ2xyY(&xyyWhitePt, WhitePt); + if (cmsTempFromWhitePoint(&tempK, &xyyWhitePt)){ char tempstr[10]; snprintf(tempstr, 10, "%5.0f", tempK); _info_concat(&ret, PyString_FromFormat("White Point: %sK", tempstr));