[eluser]old_guy[/eluser]
Most likely an obvious solution but I can't see it. I'm uploading an image file to a folder, resizing it and then writing the image path to a dB.
The original image upload works and the image path gets inserted in the dB but the image resize doesn't happen.
Hope some can help me see the what I'm not doing...code follows:
Uploading an image file as follows works fine:
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['overwrite'] = 'TRUE';
$this->load->library('upload', $config);
I then run a function to resize the image as follows:
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = array('image' => 'uploads/' .element('file_name', $this->upload->data()));
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 250;
$config['height'] = 250;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
And, finally I upload the image path to the dB:
$img_path = array('image' => 'uploads/' .element('file_name', $this->upload->data()));
$this->db->where('id', $id);
$this->db->update('personal', $img_path);