Possible Duplicate:
CodeIgniter Image thumbnailing issue笨multipIe影像縮圖問題:
我要創建兩個縮略圖withh不同尺寸相同的圖像。在我的代碼中,只有第一個縮略圖代碼創建了 ,並且發生了以下錯誤。 錯誤:「您的服務器不支持處理此類圖像所需的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' => ' '));
}
請解決我的問題我是在工作,因爲使用GD庫調整未安裝/在機器上配置不正確,圖像上週和問題得到不解決
我使用JPG,JPEG,PNG文件,如果我添加GD庫即使再發行不解決,請幫助。 –
我對GD lib根本不熟悉,但我有兩個想法。在第二部分中,您有'$ config ['create_thumb'] = FALSE;'如果將它設置爲'TRUE',會發生什麼?如果你只是評論第一部分並且只運行第二部分會發生什麼? – danneth