Welcome Guest, Not a member yet? Register   Sign In
how to generate exact same size thumbnail for different images in codeigniter
#1

[eluser]Irshad Sheikh[/eluser]
Hello,

I can generate the thumbnails of images but they all don't look
same in the size(same in height & width).

Code:
$config['upload_path'] = $path.'/user_images/';
                    $config['allowed_types'] = 'gif|jpg|png|bmp';
                    $config['max_size']='400';
                    $config['max_width'] = '1024';
                    $config['max_height']= '768';
                
                $this->load->library('upload', $config);
            
                if ( ! $this->upload->do_upload())
                {
              
                                $data['error'] = $this->upload->display_errors();
                  
                }
                        else
                        {    
                                $data = array('upload_data' => $this->upload->data());
                    $config['image_library'] = 'gd2';
                //    $config['source_image'] = '/opt/lampp/htdocs/TheInterest.com/image/'.$data['upload_data']['file_name'];
                                $config['source_image'] = $path.'/user_images/'.$data['upload_data']['file_name'];
                    $config['maintain_ratio'] = TRUE;
                    $config['width'] = 100;
                    $config['height'] = 70;
                    $config['new_image'] = $path.'/user_images/thumbs/';
            
                    $this->load->library('image_lib', $config);
                    $this->image_lib->resize();
        
                      
                        }
                     }

thanks in advance .


Messages In This Thread
how to generate exact same size thumbnail for different images in codeigniter - by El Forum - 06-30-2009, 08:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB