You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is continuation of this one: #273
That bug was caused by the "broken" PYCC.pf profile which did not include the "B" step. After the "B" was added to that profile the example code in that issue start to work fine.
Unfortunately I have found that the new updated profile can produce similar errors like before if cmsCreateTransform will be replaced by the cmsCreateMultiprofileTransform. So it cannot be saved to the memory if it was used by the cmsCreateMultiprofileTransform(). Tested on LittleCMS 2.12 and 2.13.
The test code:
#include"lcms2.h"#include<stdlib.h>voidLogErrorHandler(cmsContextContextID, cmsUInt32NumberErrorCode, constchar*Text){
fprintf(stderr, "%s\n", Text);
}
voidcheck(cmsHPROFILEhProfile) {
cmsUInt32NumberpfSize=0;
cmsHPROFILEpfSanity=NULL;
if (cmsSaveProfileToMem(hProfile, NULL, &pfSize)) {
void*buf=malloc((pfSize));
if (buf!=NULL) {
if (cmsSaveProfileToMem(hProfile, buf, &pfSize)) {
pfSanity=cmsOpenProfileFromMem(buf, pfSize);
cmsCloseProfile(pfSanity);
fprintf(stderr, "This step passed\n");
}
free(buf);
}
}
}
intmain(void) {
cmsSetLogErrorHandler(LogErrorHandler);
cmsHPROFILEmid=cmsOpenProfileFromFile(".../.../PYCC.pf", "r");
cmsHPROFILEinput=cmsCreate_sRGBProfile();
cmsHPROFILEoutput=cmsCreate_sRGBProfile();
cmsHPROFILE_iccArray[20];
intj=0;
_iccArray[j++] =input;
_iccArray[j++] =mid;
_iccArray[j++] =mid;
// can the user request same profile again? skip it for now// _iccArray[j++] = mid; // _iccArray[j++] = mid;_iccArray[j++] =output;
// this transform works fine cmsHTRANSFORMtransform=cmsCreateTransform(mid, PT_ANY,
output, PT_ANY,
INTENT_PERCEPTUAL,
cmsFLAGS_COPY_ALPHA);
cmsDeleteTransform(transform);
//// Comment the block below to solve the errorcmsHTRANSFORMhTransform=cmsCreateMultiprofileTransform(_iccArray, j,
TYPE_RGB_8, TYPE_RGB_8, INTENT_PERCEPTUAL, cmsFLAGS_COPY_ALPHA);
cmsDeleteTransform(hTransform);
//// Comment the block above to solve the errorcheck(input);
check(mid);
check(output);
cmsCloseProfile(input);
cmsCloseProfile(mid);
cmsCloseProfile(output);
return0;
}
The code above will print:
LUT is not suitable to be saved as LutAToB
Couldn't write type 'mAB '
But if the block of code is commented out(or just remove the cmsCreateMultiprofileTransform and cmsDeleteTransform) in the example, then cmsSaveProfileToMem/cmsOpenProfileFromMem will work fine.
The text was updated successfully, but these errors were encountered:
The issue is in the cmsReadTag(mid, cmsSigBToA0Tag); It decodes the tag and after that lcms cannot save the profile. If the tag is not decoded then the lcms can write it as a "raw" tag. So probably something still wrong with this profile, but for now I cannot say what exactly.
Hello.
This issue is continuation of this one: #273
That bug was caused by the "broken" PYCC.pf profile which did not include the "B" step. After the "B" was added to that profile the example code in that issue start to work fine.
The updated profile can be found here: https://bugs.openjdk.org/secure/attachment/99226/pycc2.icc
The icc inspector and ProfileDump mark this profile as "Valid".
Unfortunately I have found that the new updated profile can produce similar errors like before if
cmsCreateTransform
will be replaced by thecmsCreateMultiprofileTransform
. So it cannot be saved to the memory if it was used by the cmsCreateMultiprofileTransform(). Tested on LittleCMS 2.12 and 2.13.The test code:
The code above will print:
But if the block of code is commented out(or just remove the cmsCreateMultiprofileTransform and cmsDeleteTransform) in the example, then cmsSaveProfileToMem/cmsOpenProfileFromMem will work fine.
The text was updated successfully, but these errors were encountered: