Welcome Guest, Not a member yet? Register   Sign In
resize img two times
#1

[eluser]Unknown[/eluser]
Hello,
so the problem is this: I upload image, call my create thumb function and it creates the first file but not the second? And I don't know why.

My code:
Code:
function _createThumb($fileName){
   $this->load->library('image_lib');

   $this->image_lib->clear();
   $config['image_library'] = 'gd2';
   $config['source_image'] = 'media/uploads/pictures/' . $fileName;
   $config['new_image'] = 'media/uploads/pictures/thumbs/' . $fileName;
   $config['maintain_ratio'] = TRUE;
   $config['width'] = 150;
   $config['height'] = 100;
   $this->image_lib->initialize($config);
        
   if(!$this->image_lib->resize()){
       return $this->image_lib->display_errors();
   }
  
   $this->image_lib->clear();
   $config['new_image'] = 'media/uploads/pictures/thumbs2/' . $fileName;
   $config['width'] = 200;
   $config['height'] = 150;
   $this->image_lib->initialize($config);

   if(!$this->image_lib->resize()){
       return $this->image_lib->display_errors();
   }

   return 1;
}

I get no error Undecided


Messages In This Thread
resize img two times - by El Forum - 04-06-2011, 12:21 PM
resize img two times - by El Forum - 04-06-2011, 07:56 PM
resize img two times - by El Forum - 04-06-2011, 07:57 PM
resize img two times - by El Forum - 04-07-2011, 02:01 AM



Theme © iAndrew 2016 - Forum software by © MyBB