[mapserver-users] Polygon colors affected by a WMS layer

Daniel Morissette morissette at dmsolutions.ca
Mon May 13 16:44:20 PDT 2002


Peter Schut wrote:
> 
> I've attached an image of some bizarre behaviour that I get when I add a WMS client layer into an existing (and fully functionning) MapServer app.  The WMS layer is the light blue (rivers), and it displays properly when I call it by itself.  When this layer is added to the mapfile, a number of polygons from a locally resident soil coverage change color - to a green color that isn't even coded in the original mapfile!
> 
> Has anyone seen this behaviour before?
> 


Hi Peter,

I ran the test files that you sent me in the debugger, and it turns out
that you uncovered a GD bug in gdImagePaletteCopy().  Yes, really!

This bug will happen only in very specific circumstances, but your
application managed to bring all the required elements together to
produce it.  Basically GD confuses colors CC9966 and 99CC66 which are
both part of a default color cube alocated by MapServer, and your
MapServer mapfile happens to use color CC9966 (204 153 102). I sent a
note to the GD developers about this problem, but even if they fixed it,
the fix wouldn't be available until the next release, so in the short
term, there are two options:

1- Change color "204 153 102" in your mapfile to "203 153 102"

2- There may be a way to patch your copy of GD but that may cause other
side-effects.

I'll have to see with Frank if there is a way that we can avoid using
gdImagePaletteCopy() in the portion of mapresample.c where this happens,
but until we find another way to do things, I think #1 above is your
best option.

Daniel
-- 
------------------------------------------------------------
 Daniel Morissette               morissette at dmsolutions.ca
 DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------
  Don't put for tomorrow what you can do today, because if 
      you enjoy it today you can do it again tomorrow.




More information about the MapServer-users mailing list