Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

[codeigniter] The resize function doesn't work properly

$
0
0
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


$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

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?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>