嗨,我有這個問題,我花4-5個小時尋找一個解決方案 這裏是我的代碼pyrocms(笨圖像庫)沒有創造拇指
$config = array(
'upload_path' => './uploads/menus',
'allowed_types' => 'gif|jpg|jpeg|png',
'max_size' => '15000'
);
$this->upload->initialize($config);
if ($this->upload->do_upload('image'))
{
$image_data = $this->upload->data();
$thumbnail = 'thumb_' . $image_data['file_name'];
$thumb['image_library'] = 'gd2';
$thumb['source_image'] = $image_data['full_path'];
$thumb['create_thumb'] = TRUE;
$thumb['thumb_marker'] = '';
$thumb['new_image'] = $image_data['file_path'] . 'thumbs/' . $thumbnail;
$thumb['maintain_ratio'] = TRUE;
$thumb['width'] = 90;
$thumb['height'] = 90;
$this->load->library('image_lib', $thumb);
if($this->image_lib->resize())
{
$img_details = array(
'menu_id' => $this->db->insert_id(),
'full_path' => $image_data['full_path'],
'image_name' => $image_data['file_name'],
'thumb_path' => $thumb['new_image'],
'thumb_name' => $thumbnail,
);
$upload = $this->db->insert('menus_images', $img_details);
return $upload;
}
}
我使用PyroCMS,和我正在開發一個模塊,我需要上傳圖片。到目前爲止這麼好,我的問題是這樣的: 圖像上傳,調整大小檢查傳遞沒有問題,插入正確的數據在分貝,但在「拇指」文件夾不創建任何拇指。 如果您有任何建議,請給我一些幫助。 謝謝!
順便說一句,我忘了說,我檢查文件夾的權限,他們都設置正確 – lesandru