I have some problems managing images with CodeIgniter 1.7. Using the following code, the image loads correctly. Alas, instead of a new image made and then changed; An existing image has been resized. Any help?
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png|bmp';
$this->load->library('upload', $config);
$this->upload->do_upload();
$picloc = $this->upload->data();
$picloc = $picloc['file_name'];
$thumbnail = "thumb_".$picloc;
$imagemanip['image_library'] = 'gd2';
$imagemanip['source_image'] = './uploads/'.$picloc;
$imagemanip['new_img'] = './uploads/'.$thumbnail;
$imagemanip['maintain_ratio'] = TRUE;
$imagemanip['width'] = 250;
$imagemanip['height'] = 250;
$this->load->library('image_lib', $imagemanip);
$this->image_lib->resize();
Travis
source
share