CodeIgniter crop() without maintain_ration
- by Mango
I have this function above witch even maintain_ration set false, cutting with this proportion.
I just want crop without ratio.
function do_crop() {
$config = array(
'image_library' => 'gd2',
'source_image' => realpath(APPPATH . '../upload_img/solg6.jpg'),
'new_image' => $this->gallery_path_url . 'thumbaaa.jpg',
'maintain_ration' => false,
'width' => 150,
'height' => 150,
'x_axis' => 20,
'y_axis' => 20
);
$this->load->library('image_lib');
$this->image_lib->initialize($config);
if ( ! $this->image_lib->crop())
{
echo $this->image_lib->display_errors();
}
$this->image_lib->clear();
}