[eluser]mycr0ft[/eluser]
Hello,
I need a help with my page. I want to resize & create thumbnail of 4 uploaded images.
the problem is: the image can only resized at wrong size. I try to resize it to 400x400 (not absoulte size). but it resized to 100x100 which are the size of the thumbnail. and there is no thumbnail created.
please someone help me...
here are my codes to resize & create thumbnail:
Quote:for ($i=1;$i<5;$i++)
if ($_FILES['userfile'.$i]['name']<>''){
if ( ! $this->upload->do_upload('userfile'.$i)){
$data['errorMsg']=$this->upload->display_errors();
$this->load->view('input_product', $data);
}
else{
$foto = array('upload_data' => $this->upload->data());
$config2['source_image'] = $foto['upload_data']['full_path'];
$config2['create_thumb'] = FALSE;
$config2['width'] = 400;
$config2['height'] = 400;
$this->image_lib->initialize($config2);
if ( ! $this->image_lib->resize()){echo $this->image_lib->display_errors();}
$this->image_lib->clear();
$config2['width'] = 100;
$config2['height'] = 100;
$config2['create_thumb'] = TRUE;
$this->image_lib->initialize($config2);
if ( ! $this->image_lib->resize()){echo $this->image_lib->display_errors();}
$this->image_lib->clear();
}