2023-09-20 17:33:05 +02:00
|
|
|
/**
|
|
|
|
conversion de données gpx
|
|
|
|
conversion de données exif
|
|
|
|
**/
|
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
import * as fs from 'node:fs';
|
|
|
|
// @ts-ignore
|
|
|
|
import path from "node:path";
|
|
|
|
// @ts-ignore
|
|
|
|
import minimist from 'minimist';
|
|
|
|
// @ts-ignore
|
|
|
|
const moment = require("moment");
|
|
|
|
|
|
|
|
// configs
|
2023-10-12 10:52:04 +02:00
|
|
|
let folder = "/home/poule/encrypted/stockage-syncable/photos/imagerie kartaview carto tel/kartaview_export_storage/share2tykayn/"
|
2023-09-20 17:33:05 +02:00
|
|
|
let enable_write_gpx_file = true;
|
|
|
|
let just_one_photo_in_folder = false;
|
2023-10-12 10:52:04 +02:00
|
|
|
|
2023-09-20 17:33:05 +02:00
|
|
|
let folder_photos = folder + "photo"
|
|
|
|
|
|
|
|
let mini_arguments: any = minimist(process.argv.slice(2))
|
|
|
|
console.log('mini_arguments', mini_arguments)
|
|
|
|
|
|
|
|
if (mini_arguments['sequence']) {
|
|
|
|
sequence_name = mini_arguments['sequence']
|
|
|
|
}
|
|
|
|
|
|
|
|
function writeFile(fileName: string, fileContent: any) {
|
|
|
|
console.log('write file', fileName)
|
|
|
|
return fs.writeFile(
|
|
|
|
`${dossier_gpx}/${fileName}`,
|
|
|
|
fileContent,
|
|
|
|
'utf8',
|
|
|
|
(err) => {
|
|
|
|
if (err) {
|
|
|
|
console.log(`Error writing file: ${err}`)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
function main() {
|
|
|
|
|
2023-10-12 10:52:04 +02:00
|
|
|
// TODO make it all
|
|
|
|
// ouvrir le fichier csv
|
|
|
|
// lire ses infos, mais seulement pour les photos des premiers 160 dossiers.
|
|
|
|
|
|
|
|
// trouver les photos à partir du nom de fichier
|
|
|
|
// prendre les données du csv et les appliquer à chaque photo
|
|
|
|
// sauvegarder chaque photo
|
2023-09-20 17:33:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
// run it all
|
|
|
|
main()
|
|
|
|
|