image_lib... how to scale image down and then create a thumb in one function? - 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: image_lib... how to scale image down and then create a thumb in one function? (/showthread.php?tid=7908) |
image_lib... how to scale image down and then create a thumb in one function? - El Forum - 04-27-2008 [eluser]inktri[/eluser] For every uploaded image I want to first: scale it down to 500x500 and then create a thumbnail (a new thumbnail file is created) of the image. The below code is what I use, unfortunately the result is... a 500x500 image is generated, most of it's black, in the top left corner there is a 150x150 scaled down version of the original. If I only do one operation at a time (by commenting out the other) everything works. What am I doing wrongly? Thanks for the help. Code: // resize original to smaller 500 500 image_lib... how to scale image down and then create a thumb in one function? - El Forum - 04-27-2008 [eluser]wiredesignz[/eluser] You need to reset the image library between tasks. Read the User Guide. image_lib... how to scale image down and then create a thumb in one function? - El Forum - 04-27-2008 [eluser]mironcho[/eluser] Hi inktri, use initialize() method instead of second load->library. Check this thread: http://ellislab.com/forums/viewthread/77795/ and image lib documentation: http://ellislab.com/codeigniter/user-guide/libraries/image_lib.html |