iPhone - 从照片中获取位置信息 [英] iPhone - access location information from a photo

查看:51
本文介绍了iPhone - 从照片中获取位置信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能在 iPhone 应用程序中从使用 iPhone 相机拍摄的照片中提取位置信息(我想是地理编码)?

Is it possible, in an iPhone app, to extract location information (geocode, I suppose it's called) from a photo taken with the iPhone camera?

如果没有 API 调用来执行此操作,是否有任何已知的方法来解析数据字节以提取信息?我可以自己滚动的东西?

If there is no API call to do it, is there any known way to parse the bytes of data to extract the information? Something I can roll on my own?

推荐答案

很遗憾没有.

问题是这样的;

一个 jpeg 文件由几个部分组成.对于这个问题,我们感兴趣的是图像数据和 exif 数据.图像数据是图片,exif 数据是存储地理编码、快门速度、相机类型等信息的地方.

A jpeg file consists of several parts. For this question the ones we are interested in are the image data and the exif data. The image data is the picture and the exif data are where things like geocoding, shutter speed, camera type and so on are stored.

一个 UIImage(和 CGI​​mage)只包含图像数据,没有标签.

A UIImage (and CGImage) only contain image data, no tags.

当图像选择器选择图像(从库或相机中)时,它会返回 UIImage,而不是 jpeg.这个 UIImage 是从 jpeg 图像数据创建的,但是 jpeg 中的 exif 数据被丢弃了.

When the image picker selects an image (either from the library or the camera) it returns a UIImage, not a jpeg. This UIImage is created from the jpeg image data, but the exif data in the jpeg is discarded.

这意味着这些数据根本不在 UIImage 中,因此无法访问.

This means this data is not in the UIImage at all and thus is not accessible.

这篇关于iPhone - 从照片中获取位置信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆