|
From: Hin-Tak L. <hin...@ya...> - 2003-03-30 03:18:40
|
I have found a fix to the ghostscript 8.0 bug that I reported 2 months ago (http://bugs.ghostscript.com/show_bug.cgi?id=677383). I believe it probably affects all IJS plugins to ghostscript if one wants to use ghostscript 8.0, hence I am CC'ing the other IJS-based projects. Since gs 8.0 is not yet widely used, I suppose we just have to be aware of it and hope the next release of GNU ghostscript comes with the fix. This bug affects ghostscript 7.30-7.32 onwards up to and including 8.0 and was introduced by the colour-related DeviceN restructuring around 7.30. The fix is as follows (require recompiling ghostscript 7.30 to current) - about 15 lines counting backwards from the very end of "ghostscript/src/gdevijs.c": ===================== maxvalue = (1 << bpc) - 1; dci.num_components = components; dci.depth = bpc * components; dci.max_gray = maxvalue; ===================== A line "dci.max_components = components;" needs to be inserted. (note it is 'max_' in *addition* to the 'num_' member). Without it, "max_compoments" stays at 3 initialized elsewhere. "max_components" was introduced in gs7.30. "num_components" dates back a lot longer, although they seems to be related. I cannot find any documentation on how "max_components" is used (it only appears in about 5 places in gs 8.00, whereas "num_components" occurs in almost every file), and it seems to be set to "num_components" almost all the time. Hence the fix. Admittedly, I don't completely understand why the fix works, but it makes "epsoneplijs" works correctly. I would appreciate if say, Raph Levien, can kindly explain what "max_components" is supposed to do? And is this the correct way of fixing the bug? |