Gd2 is also enabled. Tried many ways... Don't know what's wrong
A PHP Error was encountered Severity: Notice Message: getimagesize(): Read error! Filename: libraries/Image_lib.php Line Number: 1651
Backtrace: File: /opt/lampp/htdocs/ciflix/application/controllers/Admin.php Line: 52 Function: library File: /opt/lampp/htdocs/ciflix/index.php Line: 315
Function: require_once
The provided image is not valid.
Your server does not support the GD function required to process this type of image.
$config['upload_path'] = $path;
$config['allowed_types'] = $allowed_types;
$config['max_size'] = 15000;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$this->load->library('upload', $config);
if(!$this->upload->do_upload('userfile')){
$this->session->set_flashdata('file_error', $this->upload->display_errors());
redirect('admin/create_blog');
}else{
$data = $this->upload->data('userfile');
$config['image_library'] = 'gd2';
$config['source_image'] = $path.$data['userfile'];
$config['create_thumb'] = FALSE;
$config['maintain_ratio'] = FALSE;
$config['width'] = 200;
$config['height'] = 200;
$config['new_image'] = $path.$data['userfile'];
$this->load->library('image_lib', $config);
if(!$this->image_lib->resize()){
echo $this->image_lib->display_errors();
exit();
} else {
echo "Working";
exit();
}
$post_image = $_FILES['userfile']['name'];
}
You need to install the GD extension. If it is already installed, edit your
php.ini
to enable it (delete the;
to not make it a comment ).If it isn't installed, try this:
EDIT:
I just noticed you mentioned a .dll. That's for Windows! Comment iut out, enable the
extension gd.so
, and restart the server, see if that helps!