uploading and manipulating images - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: uploading and manipulating images (/showthread.php?tid=52670) |
uploading and manipulating images - El Forum - 06-20-2012 [eluser]brian88[/eluser] Here is a function that uploads a bunch of images. Everything works fine besides a bug in the image manipulation where i highlighted the code below. There are 8 file uploads. So users can upload 8 images and then i want to resize each one of those images. Take out the image manipulation and all the images upload just fine. But with the highlighted code below it only uploads the first image and resizes it. doesnt do anymore uploads Code: $data['num_of_images'] = 8; uploading and manipulating images - El Forum - 06-20-2012 [eluser]Karman de Lange[/eluser] can you please supply the view as well please or the output of print_r($this->input->post()) thanks L: uploading and manipulating images - El Forum - 06-20-2012 [eluser]CroNiX[/eluser] You need to clear() the image_lib if you are using it in a loop as per the user guide. You shouldn't be loading the image_lib in a loop. Once is enough. Just image_lib::clear() and image_lib::initialize($config) in the loop. uploading and manipulating images - El Forum - 06-21-2012 [eluser]Otemu[/eluser] Auto load the library, then use: Code: $this->image_lib->initialize($config); Code: $this->load->library('image_lib', $config); uploading and manipulating images - El Forum - 06-21-2012 [eluser]brian88[/eluser] thanks guys, i move the image_lib loader out of the loop then i discovered that my upload and image_lib libraries both had the same variable $config. I change my image_lib config to $configResize and it worked! uploading and manipulating images - El Forum - 06-21-2012 [eluser]Karman de Lange[/eluser] [quote author="brian88" date="1340281619"]thanks guys, i move the image_lib loader out of the loop then i discovered that my upload and image_lib libraries both had the same variable $config. [/quote] HAHA , been there, done that!! uploading and manipulating images - El Forum - 10-01-2012 [eluser]Unknown[/eluser] [quote author="Otemu" date="1340276040"]Auto load the library, then use: Code: $this->image_lib->initialize($config); Code: $this->load->library('image_lib', $config); Yesterday I spent 3 hours on this and couldn't figure it out. This did the trick. Thanks a lot! |