galilio 发表于 2008-4-15 20:32:01

求助:使用image_lib中出现的问题

今天使用想用image_lib中间resize来生成缩略图,代码如下:$config['image_library'] = 'GD';
$config['source_image'] = 'mywebimg/gui3.gif';
$config['create_thumb'] = true;
$config['maintain_ratio'] = true;
$config['width'] = 75;
$config['height'] = 50;

$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize())
{
    echo $this->image_lib->display_errors();
}
基本上是手册的copy版,但是出现问题,错误提示如下:
Your server does not support the GD function required to process this type of image.
但是查看phpinfo(),可以看到是支持gif的,如下:







gdGD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.1.9 T1Lib Support enabled GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XBM Support enabled






各位帮忙解决下吧,感激不尽!




问题已经解决了,可能就是图片格式的问题,换了个jpg格式的图片,就行了,问题是我好像在之前jpg也不行啊,可能是图片的问题,有人能给出解释吗:L

[ 本帖最后由 galilio 于 2008-4-15 21:12 编辑 ]

BruceWolf 发表于 2008-4-15 22:43:30

呃,gif不能被GD直接缩放大小的吧。

yygcom 发表于 2008-7-14 09:53:37

同样的提示,但是服务器是支持gd的,图片都是jpg的,还是不行

Hex 发表于 2008-7-14 13:33:42

用 "GD2" 试试。

yxcity 发表于 2010-11-30 15:23:14

这个应该是没有初始化,

我也碰到这个问题。生成缩略图时碰到的!$this->image_lib->initialize($config);

footpeer 发表于 2011-2-13 23:43:18

$this->image_lib->initialize($config);谢谢楼上拉。
页: [1]
查看完整版本: 求助:使用image_lib中出现的问题