iPhone - access location information from a photo

后端 未结 2 1932
迷失自我
迷失自我 2020-12-30 10:23

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?

If there is no API ca

2条回答
  •  梦谈多话
    2020-12-30 11:14

    Unfortunately no.

    The problem is thus;

    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.

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

    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.

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

提交回复
热议问题