[SOLVED] Problems with Thumbnail Creation Loops - 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: [SOLVED] Problems with Thumbnail Creation Loops (/showthread.php?tid=19146) |
[SOLVED] Problems with Thumbnail Creation Loops - El Forum - 05-29-2009 [eluser]phused[/eluser] When a user uploads a file I require multiple thumbnails with different dimensions to be created, I'm trying to achieve this using the following code in a model: Code: function create_thumb($file) When I call this function, it only create the first thumbnail in the array (The first sub-array, it skips the second and third sub-array). Any idea why this is happening? [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 05-29-2009 [eluser]Evil Wizard[/eluser] because the library is only loaded once, what you want to be doing is Code: $this->load->library('image_lib', $config[0]); [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 05-29-2009 [eluser]phused[/eluser] Thanks for the solution, I actually found another way round it as well. I skipped the $this->image_lib->initialize() function from the manual, instead of loading the library all the time you use initialize() to load up your configs. I updated my code using this function and it works perfectly fine! [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 06-25-2009 [eluser]JaredKC[/eluser] This is great and totally helped me. Here is my full working controller for anyone that needs it for reference: Code: <?php I am a newbie and was able to build this with help from this forum post and this tutorial: http://net.tutsplus.com/videos/screencasts/easy-development-with-codeigniter/ [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 09-25-2009 [eluser]Mahmoud M. Abdel-Fattah[/eluser] Thanks for sharing the solution ! [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 11-12-2009 [eluser]dimazarno[/eluser] @JaredKC : thanks for sharing [SOLVED] Problems with Thumbnail Creation Loops - El Forum - 03-08-2010 [eluser]bluepicaso[/eluser] Hey JaredKC Thank you so much for sharing the code. I'm a newbie too. But u r a genius on this one. Thanx a lot buddy |