i have used two type of image creation code but both are giving error like in first
fatal error showing imagecreate() function is undefined

in seconde code
fatal errro imagecreatefromgif is undifine

what is wrong with it this function are there in php and also i m supplying right argument to it.

code is like

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>

<body>
<?php

$image['name']="imagetest.png";
$image['path']=realpath("./".$image['name']);
$font['size']=5;
//$image['id']=imagecreate(288,360);
$white=imagecolorallocate($image['id'],0xff,0xff,0xff);
$black=imagecolorallocate($image['id'],0,0,0);
imagechar($image['id'],$font['size'],10,10,"test text",$black);
imagestring($image['id'],$font['size'],40,40,"test at xy",$black);
imagepng($image['id'],$image['path']);
imagedestroy($image['id']);
print "<br> <a href=\"./".$image['name']."\" target=\"_blank\">".$image['name']."</a>";

?>
</body>
</html>

in second case

i use

<?php
Header("Content-type: image/gif");
?>

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Title here!</title>
</head>

<body>
<?php
$argv="test image";
$string=implode($argv," ");
$im = imagecreatefromgif("../images/button1.gif");
$orange = ImageColorAllocate($im, 220, 210, 60);
$px = (imagesx($im)-7.5*strlen($string))/2;
ImageString($im,3,$px,9,$string,$orange);
ImageGif($im);
ImageDestroy($im);

?>
</body>
</html>

where string is $argv which is userd

what is wrong with it please help

    yes i have two dll one is php_gd.dll and another is php_gd2.dll
    but whether it require to copy any where in system directory
    because it is in php folder.
    if it require to put in windows/system directory then i have not put there.

    i.e. i have no idea of how to use it, this library is there

      in your php.ini

      browse the file then you will find the two file..

      uncomment php_gd2.dll
      then comment php_gd.dll

      comment is ";" symbol

      restart your server then this should work

      try with phpinfo() function then browse for GD in the bottom..
      you should now see GD 2.0 or higher

        Write a Reply...