[Mapserver-users] Migration from 3.5 to 4.0

Pericles S. Nacionales nacional at cbs.umn.edu
Thu Nov 6 19:45:43 EST 2003


Vinko,

Answer to first question:  Change the "NAME png" to "NAME png24"

OUTPUTFORMAT
   NAME png24
   MIMETYPE image/png
   DRIVER GD/PNG
   EXTENSION png
   IMAGEMODE RGBA
   TRANSPARENT TRUE
END

Then specify "IMAGETYPE png24" instead of "IMAGETYPE png" on your mapfile.

As for the second question, I don't know if it will work with RGBA mode. 

And for the third question: I would think that embedding the scalebar is just 
a matter of adding "STATUS EMBED" and specifying the POSITION keyword with 
one of these values "ll, lc, lr, ul, uc, ur" in your SCALEBAR object.  You 
can also specify "TRANSPARENT TRUE" in this object.  This should work 
regardless of IMAGETYPE.

I hope this helps.


On Wednesday 05 November 2003 07:50 pm, Vinko Vrsalovic wrote:
> Hello,
>
> 	I found in some old backups a really nice app that was made in
> 	good old 3.5 times. Back then it worked perfectly. In it i embedded
> 	the scalebar in the map, with transparent set to ON, but now (with 4.0)
> 	it the bakcground is not rendered transparent, so it's blocking a
> 	part of the map. As i'm using 4.0 I tried to define the
> 	following outputformat:
>
>   OUTPUTFORMAT
>       NAME png
>       MIMETYPE image/png
>       DRIVER GD/PNG
>       EXTENSION png
>       IMAGEMODE RGBA
>       TRANSPARENT TRUE
>   END
>
> 	But when using it, i get
>
> 	gd-png:  fatal libpng error: Invalid number of colors in palette
> 	gd-png error: setjmp returns error condition
>
>
> 	I also get the same error when using IMAGEMODE RGB and TRANSPARENT FALSE
> so i guess it has to do with the number of bits instead of the
> transparent setting. It works if i set IMAGEMODE to PC256.
>
> 	I checked the list, and the problem is mentioned, but didn't
> get why it might happen.
>
> 	So three questions here, what can I be doing for it to fail that way?
> I was using a reference map with a 8bit png image, so I changed it to 24
> bits, but the problem remains.
>
> 	The second is, if I get the outputformat with RGBA to work,
> will the scalebar with transparent set to true work?
>
> 	And the third is, is there a way to embed the scalebar with
> transparent background with PC256 mode?
>
> Thanks,

-- 
Pericles S. Nacionales
Dept. of Ecology, Evolution & Behavior
College of Biological Sciences
University of Minnesota

e-mail: nacional at cbs.umn.edu
phone: 612 624 6713




More information about the mapserver-users mailing list