How to write / get latitude longitude with image in uiimagepickercontroller?

I am currently saving and drawing the following method in the album of saved photos.

UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil); 

Now I want to associate the current latitude and longitude with this image.

How can i do this?

Can I do this with my media texter (metadata).

I work in ios sdk 3.0.

Please tell me how to get / set the geodata with the image in the UIImageViewPickerController

+4
source share
4 answers

AFAIK is not supported on iOS 4.0 and below.

As with iOS 4.1, you can use -[ALAssetsLibrary writeImageToSavedPhotosAlbum:metadata:completionBlock:] to save images with metadata (untested, but I assume this should work). However, I do not know how to format the metadata dictionary.

You should try reading some existing geodata images from the resource library to check how the dictionary should be formatted.

+2
source

I am afraid that you will not be able to do this with UIImageWriteToSavedPhotosAlbum.

However, you can use a different method to save to the iphone file system (but not in the "saved photo album"). Then you save your metadata in another text file, following the image path:

For PNG:

 [UIImagePNGRepresentation(image) writeToFile: uniquePath atomically: YES]; 

For jpg:

 [UIImageJPEGRepresentation(image, 1.0) writeToFile:jpgPath atomically:YES]; 
+1
source

If you get an image from the camera, you must get it from the CLLocationManager. If you select an image from the library, you can read the location coordinates using ALAssertsLibrary:

iPhone Get UIImagePickerController Lat / Lng

Once you have a place, you can use the exif library to save the data with the image.

+1
source

you cannot get the latitude and longitude from the image that comes from uiimagepickercontroller. It seems that the tags are exif files with gambling feeds (I think for privacy reasons).

0
source

All Articles