summaryrefslogtreecommitdiff
path: root/testbed/testcms2.c
diff options
context:
space:
mode:
authorMarti Maria <mmaria@abindustries.com>2021-12-10 14:49:09 +0100
committerMarti Maria <mmaria@abindustries.com>2021-12-10 14:49:09 +0100
commit8aa70ee88c8319eb677b82aebdceb1bda1c3f0b7 (patch)
tree5065a73958cd882f19cb999893e03c13d5b555c7 /testbed/testcms2.c
parent6bef8bd0788527d46316da01b1b679fc160e0196 (diff)
downloadlcms2-8aa70ee88c8319eb677b82aebdceb1bda1c3f0b7.tar.gz
More work on premultiplied alpha
Still not tested, nor covered by testbed
Diffstat (limited to 'testbed/testcms2.c')
-rw-r--r--testbed/testcms2.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/testbed/testcms2.c b/testbed/testcms2.c
index 4098b59..8fbd417 100644
--- a/testbed/testcms2.c
+++ b/testbed/testcms2.c
@@ -7829,49 +7829,49 @@ cmsInt32Number CheckReadRAW(void)
static
cmsInt32Number CheckMeta(void)
{
- char *data;
- cmsHANDLE dict;
- cmsHPROFILE p;
- cmsUInt32Number clen;
- FILE *fp;
- int rc;
-
- /* open file */
- p = cmsOpenProfileFromFile("ibm-t61.icc", "r");
- if (p == NULL) return 0;
-
- /* read dictionary, but don't do anything with the value */
- //COMMENT OUT THE NEXT TWO LINES AND IT WORKS FINE!!!
- dict = cmsReadTag(p, cmsSigMetaTag);
- if (dict == NULL) return 0;
-
- /* serialize profile to memory */
- rc = cmsSaveProfileToMem(p, NULL, &clen);
- if (!rc) return 0;
-
- data = (char*) malloc(clen);
- rc = cmsSaveProfileToMem(p, data, &clen);
- if (!rc) return 0;
-
- /* write the memory blob to a file */
- //NOTE: The crash does not happen if cmsSaveProfileToFile() is used */
- fp = fopen("new.icc", "wb");
- fwrite(data, 1, clen, fp);
- fclose(fp);
- free(data);
-
- cmsCloseProfile(p);
-
- /* open newly created file and read metadata */
- p = cmsOpenProfileFromFile("new.icc", "r");
- //ERROR: Bad dictionary Name/Value
- //ERROR: Corrupted tag 'meta'
- //test: test.c:59: main: Assertion `dict' failed.
- dict = cmsReadTag(p, cmsSigMetaTag);
+ char *data;
+ cmsHANDLE dict;
+ cmsHPROFILE p;
+ cmsUInt32Number clen;
+ FILE *fp;
+ int rc;
+
+ /* open file */
+ p = cmsOpenProfileFromFile("ibm-t61.icc", "r");
+ if (p == NULL) return 0;
+
+ /* read dictionary, but don't do anything with the value */
+ //COMMENT OUT THE NEXT TWO LINES AND IT WORKS FINE!!!
+ dict = cmsReadTag(p, cmsSigMetaTag);
+ if (dict == NULL) return 0;
+
+ /* serialize profile to memory */
+ rc = cmsSaveProfileToMem(p, NULL, &clen);
+ if (!rc) return 0;
+
+ data = (char*) malloc(clen);
+ rc = cmsSaveProfileToMem(p, data, &clen);
+ if (!rc) return 0;
+
+ /* write the memory blob to a file */
+ //NOTE: The crash does not happen if cmsSaveProfileToFile() is used */
+ fp = fopen("new.icc", "wb");
+ fwrite(data, 1, clen, fp);
+ fclose(fp);
+ free(data);
+
+ cmsCloseProfile(p);
+
+ /* open newly created file and read metadata */
+ p = cmsOpenProfileFromFile("new.icc", "r");
+ //ERROR: Bad dictionary Name/Value
+ //ERROR: Corrupted tag 'meta'
+ //test: test.c:59: main: Assertion `dict' failed.
+ dict = cmsReadTag(p, cmsSigMetaTag);
if (dict == NULL) return 0;
cmsCloseProfile(p);
- return 1;
+ return 1;
}