<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Liu Chang</b> <span dir="ltr"><<a href="mailto:toliuch@gmail.com">toliuch@gmail.com</a>></span><br>Date: Sun, Apr 8, 2012 at 8:08 AM<br>
Subject: Re: [pmwiki-users] recipe Captcha can not display image<br>To: Esteve Boix <<a href="mailto:eboix@esteveb.com">eboix@esteveb.com</a>><br><br><br>Hi:<br><br>I removed the header(), and the default MIME type is used, which is "text/html", the browser get the following output from captcha.php:<br>
<br>�PNG
 

IHDR<    �hu �IDATH���[l U ƿ�����.�ҥ--���1� }�p MH�P/�
 �   ! k� jj|h  (�� � ƒ�  } 
�A L[ں�nm�m��wfgvƇ3=;;�[�_NN�s����οg��2�X,��  
�2x�$q��������� 1 �i�   ��~{�ޘT�Yw�Q�)�٢f�����T1 ����P� �4C����%6�B)���  ��;ˈ�
 ���3�|���Ր_  >B\�R  ��ޢ���>
� )1� ����W���� �0K ,b`���r���� R� ���   ���^�  D��o��}�U]S
 <<��M׬�H ||�Ι�)��t<$ ��k%���c��&VX!  =� �馪�]�X]���  V�� 
J�Q�I���a�#& H�ȯ��y�sQ5 ��ó ���zE� ���O S8v��@O/�� ��x< 
/���e�Y�@��� �� ���] b �k�`�%���ۺf�x�5������ �n $^  � VR `L �@O�龣'/  
�w��7���� ��� q�����  x�$���x�3��m�|��
�ƕˆ�#�����t  � �g)�
 � �[7�{� *�썾3�y�+��v��)6��ڹ�����8��Mvȡ��e����ÿ߾E�E;1�o�=����-W+ᚹ)�E�k  
�v��
xs�!fcZ/l���)�:X��q�� � kw�x9�(C_ � & �dR   �r�l͛�wF>� n{ �K=} =�� $� Z� .��i���$OLC"��Ӭ�x ��
 
�67 0�n�]an�� %�I{�Is 7��{�Y� �> ��}'�}Ȁ�rn��� � JN@�p�Z�VtN�9� �� ��* �kŮk�. #T7 C�-*����^ � �%��
� �� ��7 ��uxG$O&��� ���}y>EX 0��n  ��\� S�� ^���7��lݦ��g @&���o ����t{�i&j&V3M����N��i^���ym%����,�� Eh��"�gS:K�3� Q6ԕ��" n�U\��V���r�� �X߉9�E��q��2;j��b��:��RvT��� �(1����C� ޮ  �j�n:w��IEND�B`�<br>

<br>BTW: Did you notice that my sample php can already generate image correctly?<br><br>Thank you!<span class="HOEnZb"><font color="#888888"><br>Liu Chang</font></span><div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">
On Sat, Apr 7, 2012 at 9:58 PM, Esteve Boix <span dir="ltr"><<a href="mailto:eboix@esteveb.com" target="_blank">eboix@esteveb.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div 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 type="cite"><div><div>
      <p>This is recipe is great. However, I meet a problem to show
        image.
      </p>
      <p>The browser complains: "The image cannot be
        displayed because it contains error.".
      </p>
      <p>My PHP is able to output text to image, because
        the following code is running OK.
      </p>
      <pre><?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>This is the output.
      </p>
      <div><img src="" alt="" title=""></div>
      <p>I cannot figure out the problem of this recipe,
        but an image for CAPTCHA is essential. Anyone could help?
      </p>
      Thanks
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><pre>_______________________________________________
pmwiki-users mailing list
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
pmwiki-users mailing list<br>
<a href="mailto:pmwiki-users@pmichaud.com" target="_blank">pmwiki-users@pmichaud.com</a><br>
<a href="http://www.pmichaud.com/mailman/listinfo/pmwiki-users" target="_blank">http://www.pmichaud.com/mailman/listinfo/pmwiki-users</a><br>
<br></blockquote></div><br>
</div></div></div><br>