I have a form with a file field to upload an image, this image must be resized to fit a space on a page.
The upload works correctly, but the resize does't.
Here is how I do the resize
The source image is
![Posted Image]()
This is how CodeIgniter resizes it
![Posted Image]()
As you can see it is not correctly resized, what is the problem? How to solve it?
The upload works correctly, but the resize does't.
Here is how I do the resize
$config['image_library'] = 'gd2';
$config['source_image'] = '.'.$this->config->item('upload_image_base').'/'.'logo_'.$id.'.jpg';
$config['height'] = $this->config->item('logo_height'); //this is 80
$config['width'] = $this->config->item('max_logo_width'); //this is 300
$config['maintain_ratio'] = TRUE;
$config['master_dim'] = 'height';
$this->load->library('image_lib', $config);
$this->image_lib->resize();
The source image is

This is how CodeIgniter resizes it

As you can see it is not correctly resized, what is the problem? How to solve it?