|

楼主 |
发表于 2011-1-19 13:26:01
|
显示全部楼层
PHP复制代码
//壓成大圖
$upload_file['b_filename'] = $save_info['path'].'/b_'.$upload_file['name'];
$config = array(
'image_library' => 'gd2',
'source_image' => $upload_file['filename'],
'maintain_ratio' => true,
'width' => 1024,
'height'=> 3000,
'new_image'=> $upload_file['b_filename']
);
$this->load->library('image_lib',$config);
if (!$this->image_lib->resize())
{
$_SESSION['reg'] = 'ffff';
}else{
$_SESSION['reg'] = 'ggg';
}
$this->image_lib->resize();
// $_SESSION['reg'] = 'eeeee';
$this->image_lib->clear();
//壓成中圖
$config = array(
'image_library' => 'gd2',
'source_image' => $upload_file['b_filename'],
'maintain_ratio' => true,
'width' => 80,
'height'=> 80,
'new_image'=> $upload_file['filename']
);
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();
//壓成小圖
$upload_file['s_filename'] = $save_info['path'].'/s_'.$upload_file['name'];
$config = array(
'image_library' => 'gd2',
'source_image' => $upload_file['filename'],
'maintain_ratio' => true,
'width' => 28,
'height'=> 28,
'new_image'=> $upload_file['s_filename']
);
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();
复制代码
代碼如上,很多圖片在$this->image_lib->resize();執行到這裡的時候就死了。 |
|