calculateAngles
Versuch, es vom Browser aus zugänglich zu machen
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user