Skip to content

Commit c621c4d

Browse files
committed
Make the param of cmsCreateLab4Profile() to refer to the media white instead of the illuminant
The illuminant here is mostly useless.
1 parent 3c18c1f commit c621c4d

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/cmsvirt.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,8 +521,14 @@ cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIE
521521
{
522522
cmsHPROFILE hProfile;
523523
cmsPipeline* LUT = NULL;
524+
cmsCIEXYZ xyz;
525+
526+
if (WhitePoint == NULL)
527+
xyz = *cmsD50_XYZ();
528+
else
529+
cmsxyY2XYZ(&xyz, WhitePoint);
524530

525-
hProfile = cmsCreateRGBProfileTHR(ContextID, WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
531+
hProfile = cmsCreateRGBProfileTHR(ContextID, NULL, NULL, NULL);
526532
if (hProfile == NULL) return NULL;
527533

528534
cmsSetProfileVersion(hProfile, 4.4);
@@ -531,6 +537,7 @@ cmsHPROFILE CMSEXPORT cmsCreateLab4ProfileTHR(cmsContext ContextID, const cmsCIE
531537
cmsSetColorSpace(hProfile, cmsSigLabData);
532538
cmsSetPCS(hProfile, cmsSigLabData);
533539

540+
if (!cmsWriteTag(hProfile, cmsSigMediaWhitePointTag, &xyz)) goto Error;
534541
if (!SetTextTags(hProfile, L"Lab identity built-in")) goto Error;
535542

536543
// An empty LUTs is all we need

0 commit comments

Comments
 (0)