可能的你环境对一些函数不支持,我的就是jpg格式的图片可以,而gif格式的图片不可以。
多查些资料看看吧......

解决方案 »

  1.   

    你的那个程序是木问题的
    试试这段
    $n=6;
    $im=$data;
    $im = imagecreatefromJPEG('test.jpg');
    $im2 = imagecreate(imagesx($im)/$n,imagesy($im)/$n);
    $white = ImageColorAllocate($im2, 255,255,255);
    imagecolortransparent($im2,$white);imagecopyresized($im2,$im,0,0,0,0,imagesx($im)/$n,imagesy($im)/$n,imagesx($im),imagesy($im));
    ImageJPEG($im2);
    ImageDestroy($im);会显示一个test.jpg的1/6的小图,如果没有的话用phpinfo();看看是不是有gd支持。
    如果有的话会有这样的提示
    GD Support  enabled  
    GD Version  2.0 or higher  
    FreeType Support  enabled  
    FreeType Linkage  with freetype  
    JPG Support  enabled  
    PNG Support  enabled  
    WBMP Support  enabled  
    这是gd2的,如果想支持gif可以找一个php_gd_gif.dll的版本,改名为php_gd.dll就好了
      

  2.   

    $im = imagecreatefromJPEG('test.jpg');
    ?我的图片是从数据库里读出来的。