$picConfig['width'] = 160;
$picConfig['height'] = 200;//需要剪切的图片的宽和高,需要根据网站实际情况进行修改...
$picConfig['x_axis'] = $_POST['left'];
$picConfig['y_axis'] = $_POST['top'];
$picConfig['image_library'] = 'gd2';
$picConfig['source_image'] = $tmpImgPath;//图片路径
$picConfig['maintain_ratio']= false;
$this->image_lib->initialize($picConfig);
if(! $this->image_lib->crop()){
echo $this->image_lib->display_errors();
}else {
$tpl = 'user/cropConfirm';
$data['tmpImgPath'] = substr($tmpImgPath, 1).'?t='.substr(microtime(),0,8);
} |