@@ -185,6 +185,50 @@ cmsBool BlackPointUsingPerceptualBlack(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfi
185185 return TRUE;
186186}
187187
188+
189+ static
190+ cmsBool isInkColorspace (cmsColorSpaceSignature c )
191+ {
192+ switch (c )
193+ {
194+ case cmsSigCmykData :
195+ case cmsSigCmyData :
196+ case cmsSigMCH1Data :
197+ case cmsSigMCH2Data :
198+ case cmsSigMCH3Data :
199+ case cmsSigMCH4Data :
200+ case cmsSigMCH5Data :
201+ case cmsSigMCH6Data :
202+ case cmsSigMCH7Data :
203+ case cmsSigMCH8Data :
204+ case cmsSigMCH9Data :
205+ case cmsSigMCHAData :
206+ case cmsSigMCHBData :
207+ case cmsSigMCHCData :
208+ case cmsSigMCHDData :
209+ case cmsSigMCHEData :
210+ case cmsSigMCHFData :
211+ case cmsSig1colorData :
212+ case cmsSig2colorData :
213+ case cmsSig3colorData :
214+ case cmsSig4colorData :
215+ case cmsSig5colorData :
216+ case cmsSig6colorData :
217+ case cmsSig7colorData :
218+ case cmsSig8colorData :
219+ case cmsSig9colorData :
220+ case cmsSig10colorData :
221+ case cmsSig11colorData :
222+ case cmsSig12colorData :
223+ case cmsSig13colorData :
224+ case cmsSig14colorData :
225+ case cmsSig15colorData :
226+ return TRUE;
227+ default :
228+ return FALSE;
229+ }
230+ }
231+
188232// This function shouldn't exist at all -- there is such quantity of broken
189233// profiles on black point tag, that we must somehow fix chromaticity to
190234// avoid huge tint when doing Black point compensation. This function does
@@ -269,7 +313,7 @@ cmsBool CMSEXPORT cmsDetectBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROFILE hProfil
269313 // If output profile, discount ink-limiting and that's all
270314 if (Intent == INTENT_RELATIVE_COLORIMETRIC &&
271315 (cmsGetDeviceClass (hProfile ) == cmsSigOutputClass ) &&
272- (cmsGetColorSpace (hProfile ) == cmsSigCmykData ))
316+ (isInkColorspace ( cmsGetColorSpace (hProfile )) ))
273317 return BlackPointUsingPerceptualBlack (BlackPoint , hProfile );
274318
275319 // Nope, compute BP using current intent.
@@ -406,7 +450,7 @@ cmsBool CMSEXPORT cmsDetectDestinationBlackPoint(cmsCIEXYZ* BlackPoint, cmsHPROF
406450 if (!cmsIsCLUT (hProfile , Intent , LCMS_USED_AS_OUTPUT ) ||
407451 (ColorSpace != cmsSigGrayData &&
408452 ColorSpace != cmsSigRgbData &&
409- ColorSpace != cmsSigCmykData )) {
453+ ! isInkColorspace ( ColorSpace ) )) {
410454
411455 // In this case, handle as input case
412456 return cmsDetectBlackPoint (BlackPoint , hProfile , Intent , dwFlags );
0 commit comments