[eluser]danielpetrie[/eluser]
I'm having issues resizing an image twice, I'm able to do it once fine, but when I try to resize it an image a 2nd time, it keeps and uses the initial config options. Whats happening, is I'm allowing a user to upload an image, then I want to keep that original image, make a medium size version of the image, and a thumbnail of the image. Here's my code from the controller.
Code:
$image_data = $this->upload->data();
$config = array(
’source_image’ => $image_data['full_path'],
‘new_image’ => $this->gallery_path . ‘/thumbs’,
‘maintain_ratio’ => true,
‘width’ => 150,
‘height’ => 150
);
$this->load->library(’image_lib’, $config);
$this->image_lib->resize();
$config2 = array(
’source_image’ => $image_data['full_path'],
‘new_image’ => $this->gallery_path . ‘/large’,
‘maintain_ratio’ => true,
‘width’ => 850,
‘height’ => 650
);
$this->load->library(’image_lib’, $config2);
$this->image_lib->resize();
So when this code is run, I end up having 2 images in the '/thumbs' folder both the same size instead of 1 in there, and 1 in the '/large' folder. Anyone know how to go about doing this?