/**
  * 剪裁头像
  */
 public function facecrop(){
  $sourcefilename = $this -> input -> post('crop_filename');
  $sourcepath = UPLOADPATH.'/images/day_'.date('ymd').'/'.$sourcefilename;
  $x = $this -> input -> post('x');
  $y = $this -> input -> post('y');
  $w = $this -> input -> post('w');
  $h = $this -> input -> post('h');
  
  $config['image_library'] = 'gd2';
     $config['x_axis'] = $x;
        $config['y_axis'] = $y;
  $config['width'] = $w;
  $config['height'] = $h;
  $config['source_image'] = $sourcepath;
  $config['maintain_ratio'] = false;
  
  $this->load->library('Image_lib', $config);
  $r = $this->image_lib->crop();
  echo $r;
 }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-02-10
猜你喜欢
  • 2021-12-12
  • 2022-02-12
  • 2022-12-23
  • 2021-12-09
  • 2022-03-05
  • 2021-06-05
  • 2021-07-08
相关资源
相似解决方案