Welcome Guest, Not a member yet? Register   Sign In
image library - resizing images twice?
#1

[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?


Messages In This Thread
image library - resizing images twice? - by El Forum - 03-22-2010, 01:49 AM
image library - resizing images twice? - by El Forum - 03-22-2010, 03:56 AM
image library - resizing images twice? - by El Forum - 03-22-2010, 04:32 AM
image library - resizing images twice? - by El Forum - 03-22-2010, 09:29 AM
image library - resizing images twice? - by El Forum - 07-30-2010, 11:58 AM
image library - resizing images twice? - by El Forum - 07-30-2010, 02:31 PM



Theme © iAndrew 2016 - Forum software by © MyBB