Welcome Guest, Not a member yet? Register   Sign In
Need help with Image Manipulation Class
#1

[eluser]vincej[/eluser]
Hi - My image is being uploaded into a temp. directory very nicely. However when I want to run the image manipulation resize function on it I must be doing something wrong as the new thumbnail image is not being put into the new file. I must have something wrong with my path or my syntax because the thumbs folder is empty.

I just can not see the error - A Very Big Thank You for all Your Help !

I include the model where the reprocessing is taking place. The actual img_lib->resize takes place at the bottom.

Code:
function comment_submit(){

$data = array(
     'customerid'=> id_clean($_SESSION['userid']),
                                 'title'=> db_clean($_POST['title'],50),
     'summary' => db_clean($_POST['summary'],175),
     'body' => db_clean($_POST['recipie_body'],1500),
     'createuser' => db_clean($_POST['createuser'],35),
     );
    

  if ($_FILES){
  $config['upload_path'] = './images/';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '200';
  $config['remove_spaces'] = true;
  $config['overwrite'] = false;
  $config['max_width']  = '0';
  $config['max_height']  = '0';
  $this->load->library('upload', $config); // here is the upload
  
  if (strlen($_FILES['image']['name'])){
   if(!$this->upload->do_upload('image')){
    $this->upload->display_errors();
    exit();
   }

/// this is about getting the file path into the DB
   $image = $this->upload->data();
  
   if ($image['file_name']){
    $data['image'] = "/images/thumbs/".$image['file_name'];
  
    }
   }
  

// here is the resize //
  $config = array(
    'image_library' => 'gd2',
   'source_image' => $image['full_path'],
   'create_thumb' => TRUE,
   'new_image' => '/images/thumbs' ,
   'maintain_ration' => true,
   'width' => 150,
   'height' => 100
  );
  
  $this->load->library('image_lib', $config);
  $this->image_lib->resize();
  
  
  }
  $this->db->insert('recipies', $data);

}




Theme © iAndrew 2016 - Forum software by © MyBB