php ajax jcrop 裁剪图片,并预览
以下是php
public function save_stream_to_image_fine(){
$result = $data = array();
$data = $_POST['img'];
if($data){
$data = urldecode($data);
if(strstr($data,",")){
$data = explode(',',$data);
$data = $data[1];
}
//echo $data;
$data=base64_decode($data);
}
if($data){
$tmp_name = rand(0,1000000099).".jpg";
file_put_contents($tmp_name,$data);
$result['msg'] = '上传图片成功';
$result['code'] = 200;
$result['url'] = $tmp_name;
}
echo json_encode($result);
}
Jcrop jquery bootstrap 需要自己下载

浙公网安备 33010602011771号