1
업로드 된 이미지의 미리보기 이미지를 만들고 나중에 업로드 된 이미지의 크기를 조정하고 싶습니다. 이 내 코드입니다 :CodeIgniter 크기 조정 업로드 이미지가 작동하지 않습니다.
$data = array('upload_data' => $this->upload->data());
$upload_data = $data['upload_data'];
//Create image thumbnail
$config['image_library'] = 'gd2';
$config['source_image'] = $upload_data['full_path'];
$config['create_thumb'] = TRUE;
$config['overwrite'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 150;
$config['height'] = 150;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
//Resize original image for space saving purposes
if ($upload_data['image_width'] > 850 || $upload_data['image_height'] > 850) {
$config['image_library'] = 'gd2';
$config['source_image'] = $upload_data['full_path'];
$config['maintain_ratio'] = TRUE;
$config['create_thumb'] = FALSE;
$config['overwrite'] = TRUE;
$config['width'] = 850;
$config['height'] = 850;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
썸네일이 잘 만들어 지지만 originial 이미지의 크기 조정이 작동하지 않습니다. 내가 여기서 무엇을 놓치고 있니?
EDIT : 두 이미지 사이의 조작
$this->image_lib->clear();
: I 선을 추가하는 시도했다.
+1 여기에 자신의 솔루션을 게시! – swatkins