|
楼主 |
发表于 2009-12-15 17:33:57
|
显示全部楼层
我写成函数了...
//切图
function _Slicing($width,$height,$image,$Newimage,$Thumb=TRUE){
$config['image_library'] = 'gd2';
$config['source_image'] = $image;
$config['new_image'] = $Newimage;
$config['create_thumb'] = $Thumb;
$config['maintain_ratio'] = FALSE;
$config['width'] = $width;
$config['height'] =$height;
$this->load->library('image_lib', $config);
if ( !$this->image_lib->resize()){
$this->image_lib->clear();
return $this->image_lib->display_errors();
}
else{
$this->image_lib->clear();
return true;
}
} |
|