summaryrefslogtreecommitdiff
path: root/lcms2mt
diff options
context:
space:
mode:
authorMichael Vrhel <michael.vrhel@artifex.com>2019-02-25 19:51:16 -0800
committerMichael Vrhel <michael.vrhel@artifex.com>2019-02-25 19:51:16 -0800
commit4c741f6ff9b1ab8a0fb433af9db8d7b0db335318 (patch)
tree777560ab250b1c0457adcd0eb3da5360d5ecaca5 /lcms2mt
parentd683d1e6450d74619e6277efeebfc222d9a5cb91 (diff)
downloadghostpdl-4c741f6ff9b1ab8a0fb433af9db8d7b0db335318.tar.gz
Have lcms2mt clone method check for transform plug-ins
When cloning a transform, it is necessary to see if there are any plugins that should be used with the new data types.
Diffstat (limited to 'lcms2mt')
-rw-r--r--lcms2mt/src/cmsxform.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/lcms2mt/src/cmsxform.c b/lcms2mt/src/cmsxform.c
index 8ebfcf79b..eff144819 100644
--- a/lcms2mt/src/cmsxform.c
+++ b/lcms2mt/src/cmsxform.c
@@ -949,7 +949,7 @@ cmsBool _cmsRegisterTransformPlugin(cmsContext ContextID, cmsPluginBase* Data)
if (fl == NULL) return FALSE;
// Check for full xform plug-ins previous to 2.8, we would need an adapter in that case
- if (Plugin->base.ExpectedVersion < 2080) {
+ if (Plugin->base.ExpectedVersion < 80) {
fl->OldXform = TRUE;
}
@@ -1059,7 +1059,7 @@ _cmsFindFormatter(_cmsTRANSFORM* p, cmsUInt32Number InputFormat, cmsUInt32Number
return;
case CHANNELS_SH(3) | BYTES_SH(1) | ((CHANNELS_SH(1) | BYTES_SH(1))<<6):
p ->xform = CachedXFORM3to1;
- return;
+ return;
case CHANNELS_SH(3) | BYTES_SH(2) | ((CHANNELS_SH(1) | BYTES_SH(2))<<6):
p ->xform = CachedXFORM3x2to1x2;
return;
@@ -1590,6 +1590,9 @@ cmsHTRANSFORM cmsCloneTransformChangingFormats(cmsContext ContextID,
const _cmsTRANSFORM *oldXform = (const _cmsTRANSFORM *)hTransform;
_cmsTRANSFORM *xform;
cmsFormatter16 FromInput, ToOutput;
+ _cmsTransformPluginChunkType* ctx = (_cmsTransformPluginChunkType*)_cmsContextGetClientChunk(ContextID, TransformPlugin);
+ _cmsTransformCollection* Plugin;
+ _cmsTRANSFORMCORE *core;
_cmsAssert(oldXform != NULL && oldXform->core != NULL);
@@ -1618,6 +1621,19 @@ cmsHTRANSFORM cmsCloneTransformChangingFormats(cmsContext ContextID,
xform ->OutputFormat = OutputFormat;
xform ->FromInput = FromInput;
xform ->ToOutput = ToOutput;
+
+ /* Transformation plug-in support needed here */
+ if (oldXform->core->Lut != NULL) {
+ for (Plugin = ctx->TransformCollection; Plugin != NULL; Plugin = Plugin->Next) {
+ core = xform->core;
+ if (Plugin->Factory(ContextID, &xform->xform, &core->UserData,
+ &core->FreeUserData, &core->Lut, &InputFormat, &OutputFormat, NULL)) {
+ (void)_cmsAdjustReferenceCount(&xform->core->refs, 1);
+ return xform;
+ }
+ }
+ }
+
_cmsFindFormatter(xform, InputFormat, OutputFormat, xform->core->dwOriginalFlags);
(void)_cmsAdjustReferenceCount(&xform->core->refs, 1);