return exif data in promise

This commit is contained in:
Tykayn 2023-06-29 20:09:33 +02:00 committed by tykayn
parent 4fa3c3d92d
commit 30c1189393

View File

@ -67,15 +67,15 @@ async function guessFileNameOnAllFilesFromArguments () {
let structureForFile = finder.destructurateFileName(fileName)
// examiner les infos exif de chaque fichier pour proposer un nouveau nom
if (!structureForFile.dateStamp) {
let foundDate = finder.findExifCreationDate(fileName)
let foundDate = finder.findExifCreationDate(fileName).then((data) => {
console.log(' =>>>>>>> foundDate : ', foundDate)
if (foundDate) {
structureForFile.dateStamp = (finder.findExifCreationDate(fileName) + '')
structureForFile.dateStamp = finder.findExifCreationDate(fileName)
} else {
console.log(' pas de date trouvée dans le nom')
}
}
let newname = makeFileNameFromProperties(structureForFile)
if (fileName !== newname) {
@ -84,8 +84,12 @@ async function guessFileNameOnAllFilesFromArguments () {
console.log(' rien à changer')
}
}, (err) => {
console.error(err)
})
}
}
)
}