0
function do_upload() {
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png',
'upload_path' => $this->gallery_path,
'max_size' => 2000
);
$this->load->library('upload', $config);
$this->upload->do_upload();
$image_data = $this->upload->data();
$config = array(
'image_library' => 'gd2',
'source_image' => $image_data['full_path'],
'new_image' => $this->gallery_path . '/thumbs',
'maintain_ratio' => TRUE,
'width' => 150,
'height' => 267
);
$this->load->library('image_lib', $config);
if (! $this->image_lib->resize())
{
echo $this->image_lib->display_errors();
}
$this->image_lib->clear();
}
並給出了一個白色的頁面,不顯示錯誤。 但是,如果我擦除這條線,工作正常!
'maintain_ratio' => TRUE,
'width' => 150,
'height' => 26
問題是,我使用的圖像是擴展名爲.JPG的大寫字母。 – Mango 2010-03-10 20:54:16