[pmwiki-users] Fwd: recipe Captcha can not display image

Liu Chang toliuch at gmail.com
Sat Apr 7 19:10:29 CDT 2012


---------- Forwarded message ----------
From: Liu Chang <toliuch at gmail.com>
Date: Sun, Apr 8, 2012 at 8:08 AM
Subject: Re: [pmwiki-users] recipe Captcha can not display image
To: Esteve Boix <eboix at esteveb.com>


Hi:

I removed the header(), and the default MIME type is used, which is
"text/html", the browser get the following output from captcha.php:

�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`�

BTW: Did you notice that my sample php can already generate image correctly?

Thank you!
Liu Chang


On Sat, Apr 7, 2012 at 9:58 PM, Esteve Boix <eboix at esteveb.com> wrote:

>
> 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.
>
> Regards,
> Esteve
>
> Al 07/04/12 15:41, En/na Liu Chang ha escrit:
>
> This is recipe is great. However, I meet a problem to show image.
>
> The browser complains: "The image cannot be displayed because it contains
> error.".
>
> My PHP is able to output text to image, because the following code is
> running OK.
>
> <?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);
> ?>
>
> This is the output.
>
> I cannot figure out the problem of this recipe, but an image for CAPTCHA
> is essential. Anyone could help?
> Thanks
>
> _______________________________________________
> pmwiki-users mailing listpmwiki-users at pmichaud.comhttp://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20120408/860279ad/attachment.html>


More information about the pmwiki-users mailing list