하이를 만들려면 image_lib 이미지와 이미지의 크기를 조정할 수있는 CI 문서에 따라 그리고 우리가 여기는 이미지 크기를 조정하고 축소판을
create_thumb FALSE TRUE/FALSE (boolean) Tells the image processing function to create a thumb. R
thumb_marker _thumb None Specifies the thumbnail indicator. It will be inserted just before the file extension, so mypic.jpg would become mypic_thumb.jpg R
해당 이미지에서 추가 축소판을 만들 수 있습니다 제안 옵션이 내 코드가되어 있습니다 CodeIgniter의
$config_manip = array(
'image_library' => 'gd2',
'source_image' => "./uploads/avatar/tmp/{$this->input->post('new_val')}",
'new_image' => "./uploads/avatar/{$this->input->post('new_val')}",
'maintain_ratio'=> TRUE ,
'create_thumb' => TRUE ,
'thumb_marker' => '_thumb' ,
'width' => 150,
'height' => 150
);
$this->load->library('image_lib', $config_manip);
$this->image_lib->resize();
이 코드는 내 이미지 크기를 조정하고 또한 썸네일을 생성하지만 난 단지 지정된 크기와 _tump 접미사 하나 개의 이미지를 얻을 가정 것이다
내가했습니다 루게릭 병 o를 수동으로 두 번째 이미지를 만들려면이 코드를 추가하려하지만 여전히 작동하지 않습니다와 나는 하나 개의 이미지 만
$this->image_lib->clear();
$config_manip['new_image'] =
"./uploads/avatar/thumbnail_{$this->input->post('new_val')}";
$config_manip['width'] = 30 ;
$config_manip['height'] = 30 ;
$this->load->library('image_lib', $config_manip);
$this->image_lib->resize();
원하는 결과가 있습니까? 원래 크기를 수정하고 30x30 크기의 이미지를 만들겠습니까? –
실제로 내 원본 이미지는 보안상의 이유로 임시 폴더에 있습니다. 내 아바타 폴더에있는 크기 조정 된 파일과 미리보기 이미지를 만들고 싶습니다. – max
'create_thumb'을 제거하면이 두 부분의 코드가 트릭을 수행합니다. ''{} ''안에 함수를 실행할 수 있다는 것을 몰랐습니까? –