|
我做图片缩略图的时候提示The path to the image is not correct.
Your server does not support the GD function required to process this type of image.
百度翻译了一下是:图像的路径是不正确的,你的服务器不支持的功能需要处理这类图像。
我在控制器里的代码是:public function Welcome()
{
parent::__construct();
$this->load->helper('url');
}
public function index(){
$this->load->helper('url');
$config['image_library'] = 'gd2';
$config['source_image'] = '/images/2.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 50;
$config['height'] = 50;
$this->load->library('image_lib', $config);
if($this->image_lib->resize()){
echo "ok";
$this->load->view('file');}
else{
echo $this->image_lib->display_errors();
$this->load->view('file');
}
}
images文件是在根目录下的啊,2.jpg也存在。是不是我没有开启images文件夹的可写权限啊?怎么开启呢?
求解答 |
|