I trying to resize the image uploaded by user without cropping it.
For that I am using following code.
$config['image_library'] = 'gd2';
$config['source_image'] = './uploads/'.$name.'.jpg';
$config['new_image'] = './uploads/'.$name.'.jpg';
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->image_lib->resize();
$config['new_image'] = './uploads/'.$name.'.jpg';
$config['width'] = 1000;
$config['height'] = 400;
$this->image_lib->initialize($config);
$this->image_lib->resize();
but the problem is that it does not give me the image size 1000×400. it gives me the image with size 534×400. Is there any way to overcome this problem?
Change your
$config['maintain_ratio'] = TRUE;to $config[‘maintain_ratio’] = FALSE;