photolocations.js 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. module.exports.name = 'photolocations'
  2. module.exports.description = 'List all geolocation information for iOS photos (iOS 10+)'
  3. // Specify this reporter requires a backup.
  4. // The second parameter to func() is now a backup instead of the path to one.
  5. module.exports.requiresBackup = true
  6. // Specify this reporter supports the promises API for allowing chaining of reports.
  7. module.exports.usesPromises = true
  8. // Specify this only works for iOS 10+
  9. module.exports.supportedVersions = '>=10.0'
  10. // Reporting function
  11. module.exports.func = function (program, backup, resolve, reject) {
  12. backup.getPhotoLocationHistory()
  13. .then((history) => {
  14. // Format the output according to the configured formatter.
  15. var output = program.formatter.format(history, {
  16. program: program,
  17. columns: {
  18. 'Time': el => el.XFORMATTEDDATESTRING,
  19. 'Latitude': el => el.ZLATITUDE,
  20. 'Longitude': el => el.ZLONGITUDE,
  21. 'File': el => el.ZFILENAME
  22. }
  23. })
  24. resolve(output)
  25. })
  26. .catch(reject)
  27. }