This is my image uploading and resizing code in codeigniter.But in my client’s server the image is uploaded but not create a resized image into a folder
if($imgwidth >= 1025 && $imgheight >= 650)
{
$epld=explode('.',$ex);
$filename=date("mdyHis").".".$epld[1];
$uploaddir = './bg_images/';
$file = $uploaddir . basename($filename);
if(move_uploaded_file($_FILES['file']['tmp_name'],"./bg_images/".$filename))
{
$this->load->library('image_lib');
$config['image_library'] = 'gd2';
$config['source_image'] = $file ;
$config['maintain_ratio'] = FALSE;
$this->image_lib->initialize($config);
$this->md_image->resize_image('./bg_images/'.$filename,1025,650,'./bg_images/thumbs/'.$filename);
}
}
The bg_images is the folder name and the md_image is the library used for resizing
I can not spot any errors in your code.
Make sure you have gdlib installed by uploading a script with the following content:
The Script shows your php configuration.
Search for “gd” with your browser’s search function. No mention of “gd” would mean that you are missing this library, but you need it for image manipulation.