Results 1 to 4 of 4

Thread: php and gd

  1. #1

    php and gd

    Could anybody tell me why this script is not working.

    <?php

    $im = imagecreate(100, 30);

    $bg = imagecolorallocate($im, 255, 255, 255);
    $textcolor = imagecolorallocate($im, 0, 0, 255);

    imagestring($im, 5, 0, 0, "Hello world!", $textcolor);

    header("Content-type: image/gif");
    imagegif($im);
    ?>
    Quality web hosting PullHost.com

  2. #2
    Join Date
    Mar 2004
    Location
    St.Petersburg, Russia
    Posts
    6
    Probably it will work if you will change the last 2 strings to:

    header("Content-type: image/png");
    imagepng($im);

    GD do not like GIFs.

  3. #3
    Join Date
    Nov 2003
    Posts
    682
    GD does not support GIF because of copyright issues. It supports many other formats like JPEG and PNG.

  4. #4
    Thanks I didn't know that.
    Quality web hosting PullHost.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •