I hope to get some advice here.
I'm currently working on a little script that dynamically creates images that will serve as an overlay to other images by using transparent areas. The browser will layer these using OpenLayers.
Up to last week my prototype worked fine. The images had a completely transparent background with different colored blocks being slightly transparent.
Now the transparency is gone, I just get a black background where in the past the transparency had been. I was actively working on the script, but don't remember having changed anything substantial on the painting itself.
What I did: I updated apache on the server to fix the DOS problem regarding range requests. I checked the logs, that update did only affect apache. Config files look unchanged. No php or GD was changed if I see it right.
System is a debian squeeze. apache2 is 2.2.16-6+squeeze2, php5 is 5.3.3-7+squeeze3, php5-gd is 5.3.3-7+squeeze3
So is this an issue with the software or with my script? I have created the following code to reproduce the problem:
When invoked from the command line the image is like expected. Problem occurs when called using apache and mod_php.
$img = imagecreatetruecolor(256, 256);
imagesavealpha($img, true); // single color transparency works with savealpha = false
$transparent = imagecolorallocatealpha( $img, 0x00, 0x00, 0x00, 127 );
//imagecolortransparent($img, $transparent); // causing single-color transparency. I also want colored parts being transparent so this is no option
imagefill($img, 0, 0, $transparent);
$color_yellow = imagecolorallocatealpha($img, 255, 214, 51, 40);
imagefilledrectangle($img, 0, 0, 15, 15, $color_yellow);
Thank you already for your time,