Ejemplo n.º 1
0
    if ($result === false) {
        //切图失败时
        echo '{"erro":"' . $Shear->erro . '"}';
        //把错误发给JS /请匆随意更改"erro"的编写方式,否则JS出错
        exit;
    } else {
        $dirname = pathinfo($ShearPhoto["JSdate"]["url"]);
        $ShearPhotodirname = $dirname["dirname"] . DIRECTORY_SEPARATOR . "shearphoto.lock";
        //认证删除的密钥
        file_exists($ShearPhotodirname) && @unlink($ShearPhoto["JSdate"]["url"]);
        //密钥存在,当然就删掉原图
    }
} elseif (isset($_POST["ShearPhotoIW"]) && isset($_POST["ShearPhotoIH"]) && isset($_POST["ShearPhotoFW"]) && isset($_POST["ShearPhotoFH"]) && isset($_POST["ShearPhotoP"]) && is_numeric($JSconfig["P"] = trim($_POST["ShearPhotoP"])) && is_numeric($JSconfig["IW"] = trim($_POST["ShearPhotoIW"])) && is_numeric($JSconfig["IH"] = trim($_POST["ShearPhotoIH"])) && is_numeric($JSconfig["FW"] = trim($_POST["ShearPhotoFW"])) && is_numeric($JSconfig["FH"] = trim($_POST["ShearPhotoFH"]))) {
    $Shear = new ShearPhoto();
    //类实例开始
    $result = $Shear->html5_run($ShearPhoto["config"], $JSconfig);
    //加载HTML5已切好的图片独有方法
    if ($result === false) {
        //切图失败时
        echo '{"erro":"' . $Shear->erro . '"}';
        //把错误发给JS /请匆随意更改"erro"的编写方式,否则JS出错
        exit;
    }
} else {
    die('{"erro":"错误的操作!或缺少参数或错误参数"}');
}
/*........错误的操作................*/
/*..........................................................结果输出给JS..............................................................*/
/*
 到此程序已运行完毕,并成功!你可以在这里愉快地写下你的逻辑代码
$result[X]["ImgUrl"] //图片URL路径  X是数字