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>";
}
}
答案 0 :(得分:0)
要解决这个问题,请在下面的开头删除正斜杠,如下所示:
$config['source_image'] = $result[$i]['msg'];
$config['new_image'] = "/resources/images/upload_thumb/";
确保 $ result [$ i] [&#39; msg&#39;] 不以正斜杠
开头答案 1 :(得分:-1)
可能是您多次加载image_lib。不要多次加载image_lib。在autoload libs中添加image_lib并更改
$this->load->library('image_lib', $config);
到
$this->image_lib->initialize($config);