[eluser]xwero[/eluser]
Code:
// controller
$file = 'new_image.jpg'
$newpath = '/path/to/'.$file;
if(!file_exist($newpath)) // check for not generating rezized images multiple times
{
$config['image_library'] = 'GD';
$config['source_image'] = '/path/to/image/mypic.jpg';
$config['create_new'] = $newpath; // keeps oringinal
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 50;
$this->load->library('image_lib', $config);
$this->image_lib->resize();
}
$data['resizedurl'] = base_url().'to/path/'.$file;
$this->load->view('view',$data);
// view
<img src="<?php echo $resizedurl; ?>">
You can make it more dynamic but i think you can get the picture