I want to resize the image to 160 x 160 and make thumbnail of it and then store that thumbnail in the folder. I don't want to store the real image, but the thumbnail of it only. Below is my code:
$this->load->library('upload');
$this->load->library('image_lib');
$blog_image = $_FILES['blog_image']['name'];
$config = array ('upload_path' => './blogs/',
'allowed_types' => "jpeg|jpg|png",
'overwrite' => TRUE,
'image_library' => 'gd2',
'source_image' => $blog_image,
'create_thumb' => TRUE,
'maintain_ratio' => TRUE,
'width' => 160,
'height' => 160
);
$this->upload->initialize($config);
$this->upload->do_upload('blog_image');
$this->image_lib->resize();
This code does not work. It uploads the image without resizing it. Please Help.