Codeigniter Image resize issue
I can't re-size a large uploaded image into tow copies one in another size and the other is in another size.
I can only resize only one image.
What I want to ask is. I want to creat a thumbnail as well as slighter larger image of a user profile photo.
if(move_uploaded_file($_FILES['profilepic']['tmp_name'], './profile_pix/'. $profile_pic_name1)){
$config['image_library'] = 'gd2';
$config['source_image'] = './profile_pix/'. $profile_pic_name1;
$config['create_thumb'] = false;
$config['maintain_ratio'] = TRUE;
$config['width'] = 150;
$config['height'] = 190;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
$thumb_name = './profile_pix/thumb_'.$profile_pic_name1;
copy('./profile_pix/'. $profile_pic_name1, $thumb_name);
$config2['image_library'] = 'gd2';
$config2['source_image'] = $thumb_name;
$config2['create_thumb'] = false;
$config2['maintain_rati开发者_运维问答o'] = false;
$config2['width'] = 50;
$config2['height'] = 50;
$this->load->library('image_lib', $config2);
$this->image_lib->resize();
}
It seems that your image library is already loaded. so call the initialize()
function instead of load()
精彩评论