<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    Maybe GD is not installed on your server. Try to comment the
    "header()" instruction and see if you get "Cannot initialize new GD
    image stream" when you try to view the image in the browser.<br>
    <br>
    Regards,<br>
    Esteve<br>
    <br>
    Al 07/04/12 15:41, En/na Liu Chang ha escrit:
    <blockquote
cite="mid:CAPfDOvmpqz_FhyMn2Vbu1-J=e2bXrzPoNfsAki3ZNkaT+D_Qzw@mail.gmail.com"
      type="cite">
      <p>This is recipe is great. However, I meet a problem to show
        image.
      </p>
      <p class="vspace">The browser complains: "The image cannot be
        displayed because it contains error.".
      </p>
      <p class="vspace">My PHP is able to output text to image, because
        the following code is running OK.
      </p>
      <pre class="escaped"><?php
header("Content-type: image/png");
$im = @imagecreatetruecolor(500, 90)
              or die("Cannot Initialize new GD image stream");
$text_color = imagecolorallocate($im, 233, 104, 191);
imagestring($im, 5, 5, 5,  "A Simple Text String, Oh yeah!", $text_color);
imagepng($im);
imagedestroy($im);
?>
</pre>
      <p class="vspace">This is the output.
      </p>
      <div class="property-Attach"><img moz-do-not-send="true"
          src="http://www.pmwiki.org/pmwiki/uploads/Cookbook/php_image.png"
          alt="" title=""></div>
      <p class="vspace">I cannot figure out the problem of this recipe,
        but an image for CAPTCHA is essential. Anyone could help?
      </p>
      Thanks
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
pmwiki-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pmwiki-users@pmichaud.com">pmwiki-users@pmichaud.com</a>
<a class="moz-txt-link-freetext" href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>