[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