Hi i'm using the Codigniter image manipulation class in order to create a thumbnail with a fixed size So i wont first to resize it (So when i crop it i get a large peace of the image) And then crop it The resize works But the crop dont
Here is the function I've created
function _generate_thumbnail($filename)
{
$config['image_library'] = 'gd2';
$config['source_image'] = './project_pics/big/'.$filename;
$config['new_image'] = './project_pics/resize/'.$filename;
$config['maintain_ratio'] = TRUE;
$config['width'] = 650;
$this->load->library('image_lib');
$this->image_lib->initialize($config);
$this->image_lib->resize();
$this->image_lib->clear();
$config['image_library'] = 'gd2';
$config['source_image'] = './project_pics/resize/'.$filename;
$config['new_image'] = './project_pics/crop/'.$filename;
$config['width'] = 650;
$config['height'] = 450;
$config['x_axis'] = 0;
$config['y_axis'] = 0;
$this->load->library('image_lib');
$this->image_lib->initialize($config);
$this->image_lib->crop();
}
There are some limitation of using Codeigniter's
image_liblibrary. You can't do"resize and crop"in one go with this lib.You will have to reintialize
image_libbetween each action like this: