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 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?
The best way to find the location of a Google Earth photo is to use a reverse image search. Right-click the image you wish to search and select “Copy image address.” Visit Google Images and click the camera icon on the search bar. Paste the image address into the search bar then click “Search” button.
Nearly every photo you take on your iPhone has a batch of hidden information stored within: metadata. This metadata, known more specifically as EXIF data for images, contains descriptive information that makes each image unique. That includes the creation date, camera information and settings and your location.
When you snap a selfie, remember to look at the camera lens itself, not the camera app screen where you see a live view of yourself. (That is, unless you are intentionally looking away from the camera to create a different look.)
Download EXIF Metadata from the App Store for free. Launch the app and select a photo from your library. The app will show a map of where the photo was shot, but most importantly, it will show the GPS coordinates, altitude, and address (when available).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With