[gs-devel] colour, colour spaces and Ghostscript

Ken Sharp ken.sharp at artifex.com
Wed May 21 04:57:30 PDT 2008


Hi Igor,

At 13:42 21/05/2008 +0400, you wrote:

>I recall Dan worked on the "pop false" issue in tint transfer,
>so you should find and read related bugs and patches.
>Did you ?

I had a look, but there seems to have been a progressive deterioration 
rather than a single point introducing a regression. There are at least two 
distinct changes.

The 'pop false' isn't the problem, except that we always appear to execute 
the tint transform, even when we are rendering the spot colour.

This seems to be because at some time in the past the colour space handling 
was changed. I think whoever changed it didn't realise that it would 
prevent the custom operator .usealternate from correctly determining 
whether the alternate was in use.

I can solve that, so that we only execute the tint transform when we are 
not producing the required separation(s).

However, fixing that leads to the second problem. The tint transform for 
the DeviceN space (in the case where we support the inks) removes too many 
operands from the stack. In this case the tint transform is definitely 
broken, and Adobe relies on the interpreter not executing it.

The sampling function in zfsample.c contains code which pushes some 
sacrificial objects on the stack, so I thought it would be OK. 
Unfortunately, looking closer, the code returns an 'undefinedresult' error 
if any of them are disturbed. (though it does fix the stack before 
returning the error)

I first tried to avoid sampling the function if we don't need it, but this 
causes endless problems. For example, tiffsep calls something like 
gs_equivcolor, which relies upon running the tint transform.

For now I've patched the sampling code so that it pushes three extra 
operands (as before) and if any are consumed by the tint transform, it 
rebalances the stack and continues, silently ignoring the error. If the 
transform consumes more than three extra operands, it will still generate 
an 'undefinedresult' error.

I'm not wholly happy with this, but it does work, and I can't see a better 
solution given that we must execute the broken tint transform.

Thanks for your help,


                             Ken



More information about the gs-devel mailing list