Problem with image handling
Posted: Thu Aug 13, 2009 9:07 am
Hi,
When i run this simple script in my new VPS, the background of image is black. in other hosts the background is white. what is my mistake in php configurations?
PHP: 5.2
GD: 2.2 (all features is enable)
(image is attached)
Thank you very much.
When i run this simple script in my new VPS, the background of image is black. in other hosts the background is white. what is my mistake in php configurations?
Code: Select all
<?php
header ('Content-type: image/png');
$im = @imagecreatetruecolor(120, 20)or die('Cannot Initialize new GD image stream');
$bg_color = imagecolorallocate($im, 255, 255, 255);
imagefill($im, 0, 0, $bg_color);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, 'A Simple Text String', $text_color);
imagepng($im);
imagedestroy($im);
?>GD: 2.2 (all features is enable)
(image is attached)
Thank you very much.