PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
It is currently Wed Oct 28, 2020 2:32 pm

All times are UTC - 5 hours

Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Aug 31, 2011 6:00 pm 
Forum Newbie

Joined: Wed Aug 31, 2011 5:36 pm
Posts: 1

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.

Syntax: [ Download ] [ Hide ]

$img = imagecreatetruecolor(256, 256);
imagealphablending($img, false);
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);
header("Content-type: image/png");              

Thank you already for your time,


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC - 5 hours

Who is online

Users browsing this forum: No registered users and 10 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group