[eluser]ravikota[/eluser]
function upload_photo()
{
$FilePath= 'FilePath';
$config['upload_path'] = './photo_uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '500';
$config['max_width'] = '1024';
$config['max_height'] = '1768';
$this->upload->initialize($config);
$fupload=$this->upload->do_upload($FilePath);
echo $this->upload->display_errors('<p>', '</p>');
$f=$this->upload->data();
if($fupload)
{
$config['image_library'] = 'GD';
$config['source_image'] ='./photo_uploads/'.$f['raw_name'].$f['file_ext'];
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = '100';
$config['height'] = '100';
$config['quality']='99';
$this->image_lib->initialize($config);
//$this->load->library('image_lib', $config);
$this->image_lib->resize();
echo $this->image_lib->display_errors();
}
The above is the function in my controller. The problem is that the image is resizing but the color is not maintained in the correct ratio. If any body have solution please let me know.