michaelr n00b
Joined: 25 Jun 2002 Posts: 13
|
Posted: Fri Jun 28, 2002 4:29 am Post subject: PHP Image Generation |
|
|
I'm trying to generate PNG images using PHP. Here is the code I'm using:
Code: | <?php
$image = imagecreate(200, 200)
or die("Could not initialize GD image stream.");
$white = imagecolorallocate($image, 0xff, 0xff, 0xff);
$black = imagecolorallocate($image, 0x00, 0x00, 0x00);
imagefilledrectangle($image, 50, 50, 150, 150, $black);
header('Content-Type: image/png');
imagepng($image);
?>
|
I don't get anything back. This code works.... I've tried it on another box running an earlier version of PHP. My version of PHP (4.2.1-r1) reports the necessary options (in the GD section). However, if I change the appropiate lines to generate a JPEG image, it works. This makes me think that it's a bug in the Gentoo version.
Any thoughts? |
|