Jump to content

always black background on generated images


lucien@craft.nl

Recommended Posts

Hi,

 

I'm using this code to create an image:

 

// create a blank image

$image = imagecreatetruecolor(400, 300);

$grey = imagecolorallocate($image, 200, 200, 200); 

// fill the background color

$xyz = imagefill($image, 0, 0, $grey);

$xyz = imagecolortransparent($image, $grey);

(...) <--generate some content, which displays properly

// output the picture

imagetruecolortopalette($image, true, 256);

Imagejpeg($image, "myimage.jpg");

 

One one server (Apache, linux) the background always remains black; on other servers the same code generates nice gray background.

How can I fix this ?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.