Skip to content

Commit

Permalink
Fix a bug on CMYK gamut check when using float Lab as input space.
Browse files Browse the repository at this point in the history
For what it seems, it has been there for many years.
  • Loading branch information
mm2 committed Nov 10, 2024
1 parent 70a39bf commit 676e803
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/cmsgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,9 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
cmsUInt32Number dwFormat;
GAMUTCHAIN Chain;
cmsUInt32Number nGridpoints;
cmsInt32Number nChannels;
cmsInt32Number nChannels, nInputChannels;
cmsColorSpaceSignature ColorSpace;
cmsColorSpaceSignature InputColorSpace;
cmsUInt32Number i;
cmsHPROFILE ProfileList[256];
cmsBool BPCList[256];
Expand Down Expand Up @@ -345,11 +346,13 @@ cmsPipeline* _cmsCreateGamutCheckPipeline(cmsContext ContextID,
AdaptationList[nGamutPCSposition] = 1.0;
IntentList[nGamutPCSposition] = INTENT_RELATIVE_COLORIMETRIC;


ColorSpace = cmsGetColorSpace(hGamut);
nChannels = cmsChannelsOfColorSpace(ColorSpace);
nGridpoints = _cmsReasonableGridpointsByColorspace(ColorSpace, cmsFLAGS_HIGHRESPRECALC);
dwFormat = (CHANNELS_SH(nChannels)|BYTES_SH(2));

InputColorSpace = cmsGetColorSpace(ProfileList[0]);
nInputChannels = cmsChannelsOfColorSpace(InputColorSpace);
dwFormat = (CHANNELS_SH(nInputChannels)|BYTES_SH(2));

// 16 bits to Lab double
Chain.hInput = cmsCreateExtendedTransform(ContextID,
Expand Down

1 comment on commit 676e803

@MonkeybreadSoftware
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the help!
Seems to work now.

Please sign in to comment.