Skip to content

Commit a4c87eb

Browse files
committed
Creating an output profile by cmsTransform2DeviceLink does not propagate correctly the colorant table. Fixed.
1 parent e0641b1 commit a4c87eb

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

src/cmsvirt.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1319,12 +1319,23 @@ cmsHPROFILE CMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, cmsFloat
13191319
if (!cmsWriteTag(hProfile, DestinationTag, LUT)) goto Error;
13201320

13211321

1322-
if (xform -> InputColorant != NULL) {
1322+
// Colorant tables have special rules depening on deviceClass
1323+
if (xform -> InputColorant != NULL &&
1324+
(deviceClass == cmsSigLinkClass || deviceClass == cmsSigInputClass)) {
1325+
13231326
if (!cmsWriteTag(hProfile, cmsSigColorantTableTag, xform->InputColorant)) goto Error;
13241327
}
13251328

13261329
if (xform -> OutputColorant != NULL) {
1327-
if (!cmsWriteTag(hProfile, cmsSigColorantTableOutTag, xform->OutputColorant)) goto Error;
1330+
1331+
if (deviceClass == cmsSigLinkClass) {
1332+
1333+
if (!cmsWriteTag(hProfile, cmsSigColorantTableOutTag, xform->OutputColorant)) goto Error;
1334+
}
1335+
else
1336+
{
1337+
if (!cmsWriteTag(hProfile, cmsSigColorantTableTag, xform->OutputColorant)) goto Error;
1338+
}
13281339
}
13291340

13301341
if ((deviceClass == cmsSigLinkClass) && (xform ->Sequence != NULL)) {

0 commit comments

Comments
 (0)