問題描述
是否有可能在 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 - 從照片中獲取位置信息的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!