From 806bd807d30c440e016c7829d4f20ad7fa0e6c11 Mon Sep 17 00:00:00 2001 From: Marti Maria Date: Wed, 14 Dec 2011 14:41:13 +0100 Subject: Minor modifications for 2.3 --- doc/LittleCMS2.3 API.pdf | Bin 1117638 -> 1124282 bytes doc/LittleCMS2.3 Plugin API.pdf | Bin 487496 -> 492002 bytes doc/LittleCMS2.3 tutorial.pdf | Bin 729790 -> 736326 bytes src/cmstypes.c | 14 ++++++++++---- testbed/testcms2.c | 10 +++++----- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/doc/LittleCMS2.3 API.pdf b/doc/LittleCMS2.3 API.pdf index 8e12e70..e86ed57 100755 Binary files a/doc/LittleCMS2.3 API.pdf and b/doc/LittleCMS2.3 API.pdf differ diff --git a/doc/LittleCMS2.3 Plugin API.pdf b/doc/LittleCMS2.3 Plugin API.pdf index 194e4f8..02fecdc 100755 Binary files a/doc/LittleCMS2.3 Plugin API.pdf and b/doc/LittleCMS2.3 Plugin API.pdf differ diff --git a/doc/LittleCMS2.3 tutorial.pdf b/doc/LittleCMS2.3 tutorial.pdf index 1bdfc7a..4ad11b5 100755 Binary files a/doc/LittleCMS2.3 tutorial.pdf and b/doc/LittleCMS2.3 tutorial.pdf differ diff --git a/src/cmstypes.c b/src/cmstypes.c index e204727..4548c32 100644 --- a/src/cmstypes.c +++ b/src/cmstypes.c @@ -1221,17 +1221,23 @@ static cmsBool Type_ParametricCurve_Write(struct _cms_typehandler_struct* self, cmsIOHANDLER* io, void* Ptr, cmsUInt32Number nItems) { cmsToneCurve* Curve = (cmsToneCurve*) Ptr; - int i, nParams; + int i, nParams, typen; static const int ParamsByType[] = { 0, 1, 3, 4, 5, 7 }; + typen = Curve -> Segments[0].Type; - if (Curve ->nSegments > 1 || Curve -> Segments[0].Type < 1) { + if (Curve ->nSegments > 1 || typen < 1) { - cmsSignalError(self->ContextID, 0, "Multisegment or Inverted parametric curves cannot be written"); + cmsSignalError(self->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Multisegment or Inverted parametric curves cannot be written"); return FALSE; } - nParams = ParamsByType[Curve ->Segments[0].Type]; + if (typen > 5) { + cmsSignalError(self->ContextID, cmsERROR_UNKNOWN_EXTENSION, "Unsupported parametric curve"); + return FALSE; + } + + nParams = ParamsByType[typen]; if (!_cmsWriteUInt16Number(io, (cmsUInt16Number) (Curve ->Segments[0].Type - 1))) return FALSE; if (!_cmsWriteUInt16Number(io, 0)) return FALSE; // Reserved diff --git a/testbed/testcms2.c b/testbed/testcms2.c index fd6c16c..f070b09 100644 --- a/testbed/testcms2.c +++ b/testbed/testcms2.c @@ -495,7 +495,7 @@ cmsHPROFILE CreateFakeCMYK(cmsFloat64Number InkLimit, cmsBool lUseAboveRGB) hICC = cmsCreateProfilePlaceholder(ContextID); if (!hICC) return NULL; - cmsSetProfileVersion(hICC, 4.2); + cmsSetProfileVersion(hICC, 4.3); cmsSetDeviceClass(hICC, cmsSigOutputClass); cmsSetColorSpace(hICC, cmsSigCmykData); @@ -3482,7 +3482,7 @@ cmsInt32Number CheckMLU(void) h = cmsOpenProfileFromFileTHR(DbgThread(), "mlucheck.icc", "w"); - cmsSetProfileVersion(h, 4.2); + cmsSetProfileVersion(h, 4.3); cmsWriteTag(h, cmsSigProfileDescriptionTag, mlu2); cmsCloseProfile(h); @@ -4984,7 +4984,7 @@ cmsInt32Number CheckProfileCreation(void) h = cmsCreateProfilePlaceholder(DbgThread()); if (h == NULL) return 0; - cmsSetProfileVersion(h, 4.2); + cmsSetProfileVersion(h, 4.3); if (cmsGetTagCount(h) != 0) { Fail("Empty profile with nonzero number of tags"); return 0; } if (cmsIsTag(h, cmsSigAToB0Tag)) { Fail("Found a tag in an empty profile"); return 0; } @@ -5747,7 +5747,7 @@ cmsInt32Number CheckStoredIdentities(void) cmsSaveProfileToFile(hLink, "abstractv2.icc"); cmsCloseProfile(hLink); - hLink = cmsTransform2DeviceLink(xform, 4.2, 0); + hLink = cmsTransform2DeviceLink(xform, 4.3, 0); cmsSaveProfileToFile(hLink, "abstractv4.icc"); cmsCloseProfile(hLink); @@ -6735,7 +6735,7 @@ cmsInt32Number CheckV4gamma(void) if (h == NULL) return 0; - cmsSetProfileVersion(h, 4.2); + cmsSetProfileVersion(h, 4.3); if (!cmsWriteTag(h, cmsSigGrayTRCTag, g)) return 0; cmsCloseProfile(h); -- cgit v1.2.1