title: codeigniter $this->image_lib->resize() function not resizing image
body: <p>i want to resize image, but it not working properly, $this->image_lib->resize()  this function can not resize image. it produce orginal image size. i am upload 600*600  size image. but i want to resize 300*300
  please check my code below.</p>
  
  <pre><code>if( $this-&gt;input-&gt;post('save')){
  
          $config['upload_path'] = 'images';
          $config['allowed_types'] = 'jpg|png';
          $config['max_size'] = 1000;
          $config['overwrite'] = false;
          $config['encrypt_name'] = true;
          $this-&gt;load-&gt;library('upload', $config);
  
          $this-&gt;upload-&gt;initialize($config);
  
          if(!$this-&gt;upload-&gt;do_upload('user_image')){
              $this-&gt;session-&gt;set_flashdata('message', $this-&gt;upload-&gt;display_errors());
              $this-&gt;load-&gt;view('create',$data);
              return;
          }else{
              $upicture = $this-&gt;upload-&gt;data();
              $image_data = $upicture;
              $config2['image_library'] = 'gd2';
              $config2['source_image'] = $image_data['full_path']; //get original image
              $config2 ['new_image'] = 'images'; //save as new image //need to create thumbs first
              $config2 ['maintain_ratio'] = false;
              $config2 ['create_thumb'] = false;
              $config2 ['overwrite'] = false;
              $config2['width'] = 300;
              $config2['height'] = 300;
              $this-&gt;load-&gt;library('image_lib', $config2);
              $this-&gt;image_lib-&gt;resize();
  
              $img_name = $upicture['file_name'];
          }
  
  
          $this-&gt;form_validation-&gt;set_rules('student_name', 'Student Name','required');
          $this-&gt;form_validation-&gt;set_rules('student_email', 'Student Email','required|valid_email|is_unique[std_info.std_email]',['is_unique'=&gt; 'The {field} field is alredy exits']);
  
          $this-&gt;form_validation-&gt;set_message('valid_email','This {field} field is invalid');
          //$this-&gt;form_validation-&gt;set_message('is_unique', 'This {field} is Alreay exist!');
  
  
          $receive = $this-&gt;input-&gt;post(['student_name','student_email','student_about'], TRUE);
          $param = [
              'std_name'  =&gt; (string) $receive['student_name'],
              'std_email' =&gt; (string) $receive['student_email'],
              'std_about' =&gt; (string) $receive['student_about'],
              'images'    =&gt; $img_name
          ];
          if($this-&gt;form_validation-&gt;run()){
              $response = $this-&gt;std_model-&gt;insert_data('std_info',$param);
              if($response['status'] === 'success'){
                  redirect('welcome');
              }
          }else{
              $this-&gt;load-&gt;view('create',$data);
              return;
          }
  
      }
  </code></pre>