測試捷運站出口測試捷運站出口測試捷運站出口測試捷運站出口測站
台北市中正區忠孝東路四段200號
忠孝復興站4出口
4人
ergergregergergregergergergergergergergergergergergergeriogjeriogjioerjgoiperwjgoiejgioejgioerjgioerjgioerjgioejrgiojergiojerigojreoigjreiogjreiogjoiergjioergjioergjiorejgioerjgiorejgioerjgioerjgioerjgioerjgioerjgioerj文件
}
const file = input.target.files[index];fer
const reader = new FileReader();
reader.onload = function (e) {
const image = new Image();
image.onload = function () {
const width = image.width;
const height = image.height;
if (width > widthLimit || height > heightLimit) {
err('超出長寬', '照片尺寸需小於' + widthLimit + 'x' + heightLimit);
} else {
const imgDetail = {
name: file.name,
result: e.target.result
};
callback(imgDetail);
}
processFile(index + 1); // 处理下一个文件
};
image.src = e.target.result;
};
reader.readAsDataURL(file);
}
await processFile(0); // 开始处理第一个文件
}
export async function uploadImage(input, callback, err, widthLimit = 20000, heightLimit = 20000, limit = 10) {
async function processFile(index) {
if (index >= input.target.files.length) {
return; // 处理完所有文件
}
const file = input.target.files[index];
const reader = new FileReader();
reader.onload = function (e) {
const image = new Image();
image.onload = function () {
const width = image.width;
const height = image.height;
if (width > widthLimit || height > heightLimit) {