Skip to main content

图片矩阵变形

接口说明

  • 路径:/abby_yearbook_excel_parser

对一张平面的图片进行四角坐标的矩阵变换

这是一个支持参数的Form文件上传接口

HTML代码参考

<form id="form">
左上角坐标: <input type="text" name="left_top" value="" placeholder="50,50">
<br>

右上角坐标: <input type="text" name="left_top" value="" placeholder="x,y">
<br>

左下角坐标: <input type="text" name="right_down" value="" placeholder="50,50">
<br>

右下角坐标: <input type="text" name="left_down" value="" placeholder="x,y">
<br>

<label for="position_mode">坐标模式:</label>
<select name="position_mode" id="position_mode">
<option value="absolute">绝对定位</option>
<option value="relative">相对定位</option>
</select><br>

<input type="file" name="file">
</form>

<button onclick="upload()">提交</button>

<script>
function upload() {
var formElement = document.getElementById("form");

var xhr = new XMLHttpRequest();
xhr.open("POST", "/upload_file");
xhr.send(new FormData(formElement));
}
</script>

请求参数

参数名称类型示例说明
left_topstr"50,150"左上角坐标,中间用","分割
right_topstr"50,150"右上角坐标,中间用","分割
right_downstr"50,150"右下角坐标,中间用","分割
left_downstr"50,150"左下角坐标,中间用","分割
position_modestr"absolute""relative"
file二进制形式前端通过Form标签或者示例添加二进制形式的File,

相应结果