Jump to content

the image cannot be displayed because of errors


seco

Recommended Posts

Hi

i try the following code to write a text on image and it gives me error says: "the image cannot be displayed because of errors"

 

<?php
header("Content-type: image/png");
$im = imagecreatetruecolor(400, 30);

$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);

$text = 'www';
$font = 'arial.TTF';

imagettftext($im, 20, 0, 10, 20, $black, $font,$text);
imagepng($im);
?>

 

any idea where is the wrong?

im using wamp when i try other server it gives me the error at line 2 the header() line

any help?

 

thanks in advance.

 

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.