I'm using the excellent exifr library to read the create date from pngs. I'm looping through an array and adding data to a created marker on a map... but I'm stuck on promises!
This is what I want to do in each iteration of the loop.
exifr.parse(bottlefullurl, {xmp: true, tiff:false})
.then(output => bottledate = output.CreateDate);
jmarker.jmarkerdatedata = bottledate;
Which of course returns undefined as the promise isn't complete. I can console log it so I know the library works.
exifr.parse(bottlefullurl, {xmp: true, tiff:false})
.then(output => console.log(output.CreateDate));
The documentation is great but the examples all only console.log
https://github.com/MikeKovarik/exifr/blob/master/README.md
I've read some great answers on Stack Overflow like this one...
How do I return the response from an asynchronous call?
... and some articles and MDN docs but it's about three steps ahead of my current Javascript understanding (I can't write arrow functions).
Please help!