<?php
$im=imagecreatefromgif("img1.gif");
imagepng($im);
?>
上面是原代码,看一下能不能输出图片,但全都是乱码。extension=php_gd2.dll也去掉引号了,请大家看一看。

解决方案 »

  1.   

    header('Content-type: image/png');
      

  2.   

    图片输出前先输出header信息,否则浏览器不能识别为图片。
      

  3.   

    我改了一下
    <?php
    header('Content-type:image/gif');
    $im=imagecreatefromgif("img1.gif");
    imagegif($im);
    ?>
    但还是不行,还是乱码的吗
      

  4.   

    Warning: Cannot modify header information - headers already sent by (output started at G:\www\1.php:10) in G:\www\1.php on line 11这个就是报的错误,<?php就是第十行。
      

  5.   

    header('Content-type:image/gif');放在首行。
      

  6.   

    header函数前面不能有任何输出。程序提示第十行有输出。<?php顶格靠近最左边写。
      

  7.   

    本帖最后由 xuzuning 于 2011-07-05 14:16:31 编辑
      

  8.   

    是最顶格了最左边了,header前也没有其它输出。
      

  9.   

    前十行是html的声明,靠,我还以为声明可以了,好,行了,谢谢大家帮助。