• Create an image thumbnail in php codeigniter

    Date Posted: 09-29-2016
    Author: CEBUFREELANCER

    
    	function create_thumbnail($filename) {
    
    			$config['image_library'] = "gd2";
    			$config['source_image'] = "uploads/images/" . $filename;
    			$config['new_image']   =  "uploads/images/" . $filename;
    			$config['create_thumb'] = TRUE;
    			$config['maintain_ratio'] = TRUE;
    			
    			$config['width'] = "220";
    			$config['height'] = "298";
    			$this->load->library('image_lib', $config);
    
    			if (!$this->image_lib->resize()) {
    				echo $this->image_lib->display_errors();
    			} 
     }
     
     

Advertisement