Open gorbypark opened 7 years ago
You can solve this with a promise:
getEXIF( filePath ) {
return new Promise(resolve => {
ExifImage(filePath, (err, data) => {
resolve(data);
});
});
}
I call the getEXIF method on async function with await:
async function whatever() {
// snip
const response = await getEXIF('path to image');
// use response here
// snip
}
But you can of course resolve the promise traditional way. It's on you.
Is it possible to return the results to a parent function? I can't seem to get exifData to return. Even if i throw something like return('test test'); as the first line after ExifImage({.... it doesn't return.
The console.log returns undefined.