Problem With Image Resizing |
Hello to All Members,
I have a problem in image resizing. I have a function name as do_resize(). it gets 4 parameters and return the name of the the new resized file. the code of this function is given below. PHP Code: public function do_resize($source_file, $target_folder, $height = 128, $width = 128) This function only work for one time. I'm calling this function from a loop to resize multiple images. the code of the loop is like this. PHP Code: foreach ($data['distributors'] as $key => $item){ I'm expecting from this code is that. When I starts the loop, at each attrition of the loop it takes the profile-image path and pass to the do_resize() function which will resize the image and store it in a target folder. But it works only for first attrition of the loop. and remaining profile-images are not resized. Any one can help me to solve this issue. Thanks
IF you look at your code you will see that you are over writing your
foreach loop data $data['distributors'] What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(10-19-2017, 03:28 AM)InsiteFX Wrote: IF you look at your code you will see that you are over writing your Yes I know, I'm overwriting the original data with the modified data. There is no problem in this overwriting. In fact I found the solution for this problem and that is written below. PHP Code: $this->image_lib->initialize($config_manip); Thanks for your reply. |
Welcome Guest, Not a member yet? Register Sign In |