Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mm2/Little-CMS.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarti Maria <marti.maria@littlecms.com>2022-07-24 11:42:59 +0300
committerMarti Maria <marti.maria@littlecms.com>2022-07-24 11:42:59 +0300
commit89c9d176b4349367ecd45f85b94aea3bf6f372c9 (patch)
treeac6ec6a28b7d6585db310d5d2cb0c8595e8832b5
parent6849af422fd296cb8ce160d376978ef5d79f9417 (diff)
Fix CMYK range on fast float plugin
Range should be in %
-rw-r--r--plugins/fast_float/src/fast_float_tethra.c20
-rw-r--r--src/cmsio0.c4
2 files changed, 22 insertions, 2 deletions
diff --git a/plugins/fast_float/src/fast_float_tethra.c b/plugins/fast_float/src/fast_float_tethra.c
index 72c872b..ef4fccf 100644
--- a/plugins/fast_float/src/fast_float_tethra.c
+++ b/plugins/fast_float/src/fast_float_tethra.c
@@ -273,9 +273,29 @@ cmsBool OptimizeCLUTRGBTransform(_cmsTransform2Fn* TransformFn,
// Add the CLUT to the destination LUT
cmsPipelineInsertStage(OptimizedLUT, cmsAT_BEGIN, OptimizedCLUTmpe);
+ // If output is CMYK, add a conversion stage to get %
+ if (T_COLORSPACE(*OutputFormat) == PT_CMYK) {
+
+ static const cmsFloat64Number mat[] = { 100.0, 0, 0, 0,
+ 0, 100.0, 0, 0,
+ 0, 0, 100.0, 0,
+ 0, 0, 0, 100.0 };
+
+ cmsStage* percent = cmsStageAllocMatrix(ContextID, 4, 4, mat, NULL);
+ if (percent == NULL) goto Error;
+
+ cmsPipelineInsertStage(OriginalLut, cmsAT_END, percent);
+ }
+
// Resample the LUT
if (!cmsStageSampleCLutFloat(OptimizedCLUTmpe, XFormSampler, (void*)OriginalLut, 0)) goto Error;
+
+ if (T_COLORSPACE(*OutputFormat) == PT_CMYK) {
+
+ cmsPipelineUnlinkStage(OriginalLut, cmsAT_END, NULL);
+ }
+
// Set the evaluator, copy parameters
data = (_cmsStageCLutData*) cmsStageData(OptimizedCLUTmpe);
diff --git a/src/cmsio0.c b/src/cmsio0.c
index 205f829..545dfff 100644
--- a/src/cmsio0.c
+++ b/src/cmsio0.c
@@ -804,9 +804,9 @@ cmsBool _cmsReadHeader(_cmsICCPROFILE* Icc)
}
Icc ->TagCount++;
- }
+ }
- return TRUE;
+ return TRUE;
}
// Saves profile header