用户
 找回密码
 入住 CI 中国社区
搜索
查看: 5449|回复: 5
收起左侧

[已解决] 求助:使用image_lib中出现的问题

[复制链接]
发表于 2008-4-15 20:32:01 | 显示全部楼层 |阅读模式
今天使用想用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的,如下:







gd
GD 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也不行啊,可能是图片的问题,有人能给出解释吗

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

原图

原图

生成的缩略图

生成的缩略图
发表于 2008-4-15 22:43:30 | 显示全部楼层
呃,gif不能被GD直接缩放大小的吧。
发表于 2008-7-14 09:53:37 | 显示全部楼层
同样的提示,但是服务器是支持gd的,图片都是jpg的,还是不行
发表于 2008-7-14 13:33:42 | 显示全部楼层
用 "GD2" 试试。
发表于 2010-11-30 15:23:14 | 显示全部楼层
这个应该是没有初始化,

我也碰到这个问题。生成缩略图时碰到的!  $this->image_lib->initialize($config);
发表于 2011-2-13 23:43:18 | 显示全部楼层
$this->image_lib->initialize($config);谢谢楼上拉。

本版积分规则