I am uploading an image and creating thumbnail for different size. The category are 32px/32px, 64px/64px, 150px/150px. It doing all great except one. It calculates the hieght automatically base on “maintain_ratio” = true property. But i don’t want that. it should be fixed with my defined dimension. But i can’t found such option for that. So do you any idea how i can do this??
+2
A:
here is my image_lib setting..
$this->load->library('image_lib');
$imageinit['source_image'] = $path;
$imageinit['maintain_ratio'] = false;
$imageinit['width'] = $width;
$imageinit['height'] = $height;
$this->image_lib->initialize($imageinit);
if(!$this->image_lib->resize()){
echo $this->image_lib->display_errors();
}
just set the maintain_ratio to false, and set your width and height. it works fine for me..
you can see the complete preference of image_lib here.. http://codeigniter.com/user_guide/libraries/image_lib.html
ariawan
2010-10-26 04:46:37