CodeIgniter Forums
Image lib bug or is it my fault? SOLVED - 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 bug or is it my fault? SOLVED (/showthread.php?tid=3461)



Image lib bug or is it my fault? SOLVED - El Forum - 10-03-2007

[eluser]Jamongkad[/eluser]
Hi all this seems like a small problem but annoying nonethelesss. When I upload one image I made a function that would do two resize calls. One that makes a thumb another a medium size image. Now I searched all around and tried to implement the solutions but it doesn't seem to work.
Code:
$file = $this->upload->data();
     $this->load->library('image_lib');
    
     $config['image_library'] = 'GD';
     $config['source_image'] = './sprocket_files/'.$file['file_name'];
     $config['new_image'] = './sprocket_files_thumbs/'.$file['file_name'];
     $config['create_thumb'] = FALSE;
     $config['maintain_ratio'] = TRUE;
     $config['width'] = 75;
     $config['height'] = 50;
     $this->image_lib->initialize($config);
     /*$this->load->library('image_lib',$config);*/
     $this->image_lib->resize();
    
    
     $config2['new_image'] = './sprocket_files_resized/'.$file['file_name'];
     $config2['create_thumb'] = FALSE;
     $config2['maintain_ratio'] = TRUE;
     $config2['width'] = 367;
     $config2['height'] = 287;
    
     $this->image_lib->clear();
     $this->image_lib->initialize($config2);
     /*$this->load->library('image_lib',$config2);*/
     $this->image_lib->resize();
    
     $this->insertSprocketData();

Thanks and more power to CI!


Image lib bug or is it my fault? SOLVED - El Forum - 10-03-2007

[eluser]Jamongkad[/eluser]
Whoops forget it problem solved!