简体   繁体   English

将 HDR 照片从 iPhone 上传到网络 - GPS 数据丢失

[英]Uploading HDR photo from iPhone to web - GPS data missing

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.对于从 iPhone 和 Android 上传的照片,一切都运行良好,没有任何问题。

However, I have got a problem with iPhone HDR photos.但是,我遇到了 iPhone HDR 照片的问题。 They don't seem to contain the GPS tags.它们似乎不包含 GPS 标签。

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.使用 XCode iPhone 模拟器,默认情况下有一张 HDR 照片,它出现在 iPhone 自己的地图表示上,因此显然有与某处图像相关联的 GPS 数据。

I've tried node libraries exif-js and exif-parser, both with the same results.我已经尝试过节点库 exif-js 和 exif-parser,两者都具有相同的结果。

Has anyone got any insights?有没有人有任何见解?

I'm a developer of a relatively new library exifr you might want to try.我是一个相对较新的库exifr的开发人员,您可能想尝试一下。 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.如果它不包含您需要的数据,我很乐意查看它,只需在 github 上打开一个问题并发布对您不起作用的图像。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM