1

I've got a photo uploading website that allows people to upload photos from their phones onto a map. All is working well with photos uploaded from iPhone and Android with no issues.

However, I have got a problem with iPhone HDR photos. They don't seem to contain the GPS tags.

Using the XCode iPhone Emulator, there's one HDR photo in there by default and that appears on the iPhone's own map representation so there's obviously GPS data associated with the image somewhere.

I've tried node libraries exif-js and exif-parser, both with the same results.

Has anyone got any insights?

Ted
  • 551
  • 1
  • 7
  • 16

1 Answers1

2

I'm a developer of a relatively new library exifr you might want to try. It's new, maintained and actively developed library with focus on performance. Try out the library's playground and experiment with images and their output, or check out the .repository and docs. If it does not contain the data you need I would gladly look into it, just open an issue on github and post the images that don't work for you.

<script src="https://unpkg.com/exifr@2.1.3/index.js"></script>
<script>
    async function getExif() {
        let output = await exifr.parse(imgElementOrBuffer)
        console.log('gps', output.latitude, output.longitude)
    }
</script>
Mike Kovařík
  • 244
  • 2
  • 8