[ka-Map-users] precache2.php and transparency

David Badke dbadke at uvic.ca
Thu Oct 5 14:16:01 EDT 2006


I have some raster images, PNG24 format, with irregular edges on a 
transparent "background". If I let tile.php render the tiles, they show 
up with the correct transparency around the edges. If I use the latest 
precache2.php to render the tiles, the tiles that should be transparent 
are black, though the metatiles have the correct transparency.

After much puzzlement and comparing precache2 to tile, I found that 
adding the two alpha channel lines from tile to precache2 
[ImageAlphaBlending($oTile, false); imagesavealpha($oTile, true);] and 
commenting out the imagecolortransparent($oTile, $nTransparent); line, 
resulted in correct transparent tiles. The puzzling thing is that the 
alpha channel code in tile.php is only executed if the $useAlphaCh 
variable is true, which only happens if the image format is set to 
ALPHA. Mine is set to PNG24 (eg: the tile parameters are 
tile.php?map=AP1976&t=-256&l=0&s=240&g=Base&i=png24&version=89).

Can anyone explain why the tile.php code works (despite not executing 
the two magic lines), the unmodified precache2.php code does not work, 
and the modified precache2 code works? And will having the alpha channel 
code always executing in precache2 cause problems for images that may 
not have transparency?

David

-- 

David Badke
Humanities Computing and Media Center
University of Victoria, BC, Canada



More information about the ka-Map-users mailing list