[eluser]catiaresende[/eluser]
Hi,
I need some help because I don't understand why the code doesn't resize uploaded images.
Actually I'm using GalleryCMS, so, I have the code to upload them, to create the thumbnail and, after that I added this code to resize:
Code:
function resize($fileName, $ext) {
$mainimage = '../galeria/fotos/'.$fileName.'.'.$ext;
list($width, $height, $type, $attr) = getimagesize($mainimage);
$config['image_library'] = 'GD2';
$config['source_image'] = $mainimage;
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 400;
$config['height'] = 400;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();
}
Below the code to upload, I have this too:
Code:
$uploadImage = '../galeria/fotos/'.$newname;
write_file($uploadImage, $file);
$this->_createThumbnail($md5Date, $ext, $thumbWidth, $thumbHeight, $newname, $thumbname);
$this->resize($md5Date, $ext, $thumbWidth, $thumbHeight, $newname, $thumbname);
} else {
$this->load->view('gallery_view');
}
Any idea?
Greetings.