calculateAngles

Versuch, es vom Browser aus zugänglich zu machen
This commit is contained in:
chk
2026-05-11 16:46:26 +02:00
parent 33c946867e
commit ba2cc8f6ec
6 changed files with 537 additions and 6 deletions

View File

@@ -207,6 +207,7 @@ app.get('/api/latest-snapshot', (req, res) => {
}
const latestFile = csvFiles[0];
const baseName = path.basename(latestFile.name, path.extname(latestFile.name));
const jsonFilename = `${baseName}.json`;
const imageFilename = `${baseName}_annotated.jpg`;
const imagePath = path.join(snapshotsDir, imageFilename);
const imatePath2 = imagePath.includes('video0') ? imagePath.replace('video0', 'video1') : imagePath.replace('video1', 'video0');
@@ -223,6 +224,17 @@ app.get('/api/latest-snapshot', (req, res) => {
content: data
};
// Lade JSON wenn vorhanden
fs.readFile(jsonFilename, { encoding: 'base64' }, (jpgErr, jpgBase64) => {
if (!jpgErr && jpgBase64) {
response.imageFile = {
filename: jsonFilename,
mimeType: 'json',
contentBase64: jpgBase64
};
}
});
// Lade beide Bilder
fs.readFile(imagePath, { encoding: 'base64' }, (jpgErr, jpgBase64) => {
if (!jpgErr && jpgBase64) {