Welcome Guest, Not a member yet? Register   Sign In
Resize and crop - strange
#1

[eluser]K-C[/eluser]
I have these lines in my code.

Code:
$this->load->library('image_lib');
$uploadDir = $basepath.'/imgs/library/thumb_small/';
$oriDir = $basepath.'/imgs/library/';

// let's create a thumbnail while we're here.
$config2['image_library'] = 'GD2';
$config2['source_image'] = $oriDir.$img['file_name'];            
$config2['create_thumb'] = true;
$config2['maintain_ratio'] = true;
$config2['width'] = 66;
$config2['height'] = 66;

$config2['new_image'] = $uploadDir.$img['file_name'];
                
$this->image_lib->initialize($config2);
$this->image_lib->resize();


But strange thing is I found out the Image_lib called resize function follow up by crop
function. Anyone know why?

Following are what I see when I try to echo the parameter in
$copy($dst_img, $src_img, 0, 0, $this->x_axis, $this->y_axis, $this->width, $this->height, $this->orig_width, $this->orig_height);

Resource id #49,Resource id #48,0,0,0,0,66,21,480,147
Resource id #54,Resource id #53,0,0,0,0,66,21,66,21




Theme © iAndrew 2016 - Forum software by © MyBB