【发布时间】:2014-04-29 10:32:18
【问题描述】:
Your server does not support the GD function required to process this type of image. 正在砸我的头。我不明白哪一部分是错的!路径应该是准确的。
鉴于源图片是 resources/images/upload/BAACN_13853.jpeg
for($i=0; $i<count($result); $i++){
if($result[$i]['condition'] == "Success"){
//**************** RESIZE *******************/
$config['image_library'] = 'GD2';
$config['source_image'] = $result[$i]['msg'];
$config['new_image'] = "/resources/images/upload_thumb/";
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
if($width != NULL || $width != 0){
$config['width'] = $width;
}
if($width != NULL || $width != 0){
$config['height'] = $height;
}
$this->load->library('image_lib', $config);
if($this->image_lib->resize()){
echo $result[$i]['msg']." resized successfully.<br>";
}else{
echo $result[$i]['msg']." resized failed!!<br>";
};
$this->image_lib->clear();
}else{
echo $result[$i]['msg']."<br>";
}
}
【问题讨论】:
-
你有什么样的服务器操作系统?您可能需要安装 php-gd 模块
-
我在 Windows 7 上使用 WAMP。如何安装它?
-
对了,已经启用了。
-
它究竟在哪一行抛出异常?在 $this->image_lib->resize() 上?请在此处添加 resize() 函数体。也请在此处发布 phpinfo() 输出。
-
你也可以显示 HTML 吗?
标签: php codeigniter