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

Peter Schut SCHUTP at em.agr.ca
Tue May 14 12:39:45 EDT 2002


Thanks Daniel.

It looks like more than one part of the color cube are affected, since I see "102 204 0" also causes similar problems, as does "152 204 51".  Having found three, I suspect there are more (all involving 204?).  Anyway, thanks again for your help and for the workaround (which works).

It figures that I'd find a bug....

Cheers, Peter.



--
Peter Schut
         Head, CanSIS - Agriculture & Agri-Food Canada
         tel: 613 759-1874     http://sis.agr.gc.ca/cansis 

"We do not inherit the land from our fathers; we borrow it from our children."

>>> Daniel Morissette <morissette at dmsolutions.ca> May 13, 2002 7:44:20 PM >>>
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