title: resize of image not working in codeigniter 3
body: <p>I've been attempting to resize a image in codeigniter 3 ,but no luck! I have the resize inside the ddoo_upload() function , the resize() will work , when it comes to one image field within that form and if you will add two image field within that form , then the resize() will not work. Not sure what is wrong! </p>
  
  <p>This is what i have tried for image upload,The code below shows my upload function (and resize within it)</p>
  
  <pre><code>if (isset($_FILES['destiimg']) &amp;&amp; $_FILES['destiimg']['name'] != '') {
                      $filename = $this-&gt;ddoo_upload('destiimg', '2000' , '336');
  } else {
                      $filename = NULL;
  } 
  
  if (isset($_FILES['destiimg_thumb']) &amp;&amp; $_FILES['destiimg_thumb']['name'] != '') {
                      $destbannerthumb_imgnew = $this-&gt;ddoo_upload('destiimg_thumb', 300 , 225);
                  } else {
                      $destbannerthumb_imgnew = NULL;
                  } 
  
  
  
  
  
  
  
  
  function ddoo_upload($filename, $width, $height)
  {
      $config['upload_path'] = './uploads/';
      $config['allowed_types'] = 'jpg|jpeg|png|gif';  
      $config['overwrite'] = FALSE;
      $config['encrypt_name'] = TRUE;
  
      $this-&gt;load-&gt;library('upload', $config);
      if ( ! $this-&gt;upload-&gt;do_upload($filename)) {
          echo $this-&gt;upload-&gt;display_errors();die();
          return NULL;
      } else {
  
          $data = $this-&gt;upload-&gt;data();          
          $filename = $data['file_name'];
  
          $config1['image_library'] = 'gd2';
          $config1['source_image'] = $this-&gt;upload-&gt;upload_path.$this-&gt;upload-&gt;file_name;
          //$config1['create_thumb'] = TRUE;
          $config1['maintain_ratio'] = FALSE;
          $config1['width'] = $width;
          $config1['height'] = $height;
  
          $this-&gt;load-&gt;library('image_lib', $config1);
          $this-&gt;image_lib-&gt;resize();
  
          return $filename;
      }
  }
  </code></pre>
  
  <p>The upload works fine , but the resize has some issue.</p>