こんにちは、ciドキュメントによると、image_libで画像のサイズを変更でき、その画像から追加のサムネイルを作成できることを示唆するオプションがあります
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
ここに私のコードがあります
$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 接尾辞を持つ画像は 1 つしか取得できません
このコードを追加して2番目の画像を手動で作成しようとしましたが、それでも機能せず、画像が1つしか取得できません
$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();