title: Image resize not working in CodeIgniter 3
body: <p>I am developing a web application. In my application, I am uploading an image to server and then resize it. I uploaded to server successfully. But when I resize image, it is not resizing image. But it is not throwing error as well. </p>
  
  <p>This is my image file upload model</p>
  
  <pre><code>class file_helper extends CI_Model{
  
      function __construct()
      {
          parent::__construct();
          $this-&gt;load-&gt;library('image_lib');   
      }
  
      function generateRandomFileName()
      {
          $rand = rand(10000,99999);
          $file_name = time().$rand;
          return time().$rand;
      }
  
      function uploadImage()
      {
          $name = $this-&gt;generateRandomFileName();
          $config['upload_path']          = './'.UPLOAD_FOLDER.'/';
          $config['allowed_types']        = 'gif|jpg|png|jpeg';
          $config['file_name'] = $name;
  
          $this-&gt;load-&gt;library('upload', $config);
  
          if ( !$this-&gt;upload-&gt;do_upload('userfile'))
          {
              return FALSE;
          }
          else
          {
              $data = $this-&gt;upload-&gt;data();
              $data['virtual_path'] = UPLOAD_FOLDER."/".$name.".".$data['file_ext'];
              return $data;
          }
      }
  
  
      function resizeImage($path)
      {
          $config['image_library'] = 'gd2';
          $config['source_image'] = '/'.$path;
          $config['create_thumb'] = TRUE;
          $config['maintain_ratio'] = TRUE;
          $config['width']         = 300;
          $config['height']       = 50;
  
          $this-&gt;load-&gt;library('image_lib', $config);
  
          if ( ! $this-&gt;image_lib-&gt;resize())
          {
              print_r($this-&gt;image_lib-&gt;display_errors());
          }
          else{
              echo "Ok";
          }
      }
  
  }
  </code></pre>
  
  <p>As you can see in the model I print out "Ok" on success and print_r the error in failure. The path I passed is something like this "uploads/23344545.png". But that resize function always print out "Ok", but the image is not resized. What is wrong with my code? </p>