CodeIgniter Forums
[SOLVED] Image Resize not working. - 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] Image Resize not working. (/showthread.php?tid=52425)



[SOLVED] Image Resize not working. - El Forum - 06-10-2012

[eluser]solid9[/eluser]
I have these codes below,

Code:
function resize_product_photo_test() {
  $config['image_library'] = 'gd2';
  //$config['source_image'] = '/home/xeon9/public_html/barterswapping.com/photo-product/android.jpg';
  $config['source_image'] = './photo-product/android.jpg';
  $config['create_thumb'] = TRUE;
  $config['maintain_ratio'] = TRUE;
  $config['width'] = 150;
  $config['height'] = 100;
  
  $this->load->library('image_lib', $config);
  
  if (!$this->image_lib->resize())
  {
      echo $this->image_lib->display_errors();
  } else {
   echo 'resize done!';  
  }
}

And I don't know why it's not resizing the image?
I tested it and it show no error.
What could be the problem?

Thanks in advanced.


[SOLVED] Image Resize not working. - El Forum - 11-05-2012

[eluser]behnampmdg3[/eluser]
I've got exact same issue!


[SOLVED] Image Resize not working. - El Forum - 11-05-2012

[eluser]behnampmdg3[/eluser]
I found the error:

I had to add this:

Code:
$this->image_lib->initialize($config);
   $this->load->library('image_lib', $config);
daaaa