Hmm, first thing, this leads me to an error. As far as I can see, there is a bug in xicc/extracticc.c fixed by the attached patch. That out of the way, the rest seems to work OK. Now for creating a gamut-mapped profile ... Btw., regarding comment around the need for more docs about gamut-mapping. There is smth. actually there. Only, first time I read it, I didn't even remotely grasp what it was all about. I think some sort of troubleshooting tips would be nice, like: If your colour looks odd, look here first, then there, then try this ... Dunno if it is feasible for all sort of issues people might have, or worthwile for a majority (like writing this would solve 60% of people's problems). Karl.
--- xicc/extracticc.c.orig 2009-01-03 14:24:59.000000000 +0100 +++ xicc/extracticc.c 2009-01-03 16:18:49.000000000 +0100 @@ -110,7 +110,7 @@ error("unable to find ICC profile tag in TIFF file '%s'",in_name); } - TIFFClose(rh); /* Close Input file */ +// TIFFClose(rh); /* Close Input file */ if ((fp = new_icmFileStd_name(out_name, "w")) == NULL) { error("unable to open outpu ICC profile '%s'",out_name); @@ -120,6 +120,10 @@ error("error writing file '%s'",out_name); } + // Apparently TIFFClose frees the buffer allocated during TIFFGetField + // above. This may lead to a segfault when writing the ICC file. + TIFFClose(rh); /* Close Input file */ + if (fp->del(fp) != 0) { error("error closing file '%s'",out_name); }