喜根据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后缀
我也一直在努力,将此代码添加到手动创建第二图像,但仍然不工作,我得到的只有一个图像
$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();