我想为同一张图片创建两个不同大小的缩略图。在我的代码中只创建了第一个缩略图代码 并发生以下错误。 错误:“您的服务器不支持处理此类图像所需的GD功能。”
function createThumb1($imageName) //file name passed
{
// this thumbnail created
$config['image_library'] = 'gd2';
echo $config['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$imageName;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = false;
$config['width'] = 80;
$config['height'] = 80;
$config['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/uploads/thumbs/'.$imageName;
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize()){echo $this->image_lib->display_errors();}
$this->image_lib->clear();
// unable to create this this thumbnail
$config['image_library'] = 'gd2';
echo $config['source_image'] = $_SERVER['DOCUMENT_ROOT'].'/uploads/'.$imageName;
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = false;
$config['width'] = 696;
$config['height'] = 241;
$config['new_image'] = $_SERVER['DOCUMENT_ROOT'].'/images/uploads/'.$imageName;
$this->load->library('image_lib', $config);
if ( ! $this->image_lib->resize()){echo $this->image_lib->display_errors();}
$this->image_lib->clear();
$this->load->view('admin/upload_form',array('error' => ' ' ));
}
请解决我的问题我从上周开始工作,问题得不到解决