Welcome Guest, Not a member yet? Register   Sign In
image resize
#1

[eluser]vbnullchar[/eluser]
how can i resize image then directly displayed in the browser..?
#2

[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="&lt;?php echo $resizedurl; ?&gt;">
You can make it more dynamic but i think you can get the picture
#3

[eluser]vbnullchar[/eluser]
cool thanks...

setting dynamic_output to TRUE does the trick for me

Code:
$config['dynamic_output'] = TRUE;


thanks again




Theme © iAndrew 2016 - Forum software by © MyBB