Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 11-27-2009, 11:00 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 22
haniar is on a distinguished road
Default Read Exif GPS data using UIImagePickerController

Hi,

I would like to read the GPS data (lat / lon) for a picture that has been selected by the user using UIImagePickerController.

Selecting the picture works but how can I access the geo data?

I have looked at iphone-exif (iphone-exif - Project Hosting on Google Code) project but it does not seem to work with UIImage.

Any suggestions

Thanks
haniar is offline   Reply With Quote
Old 11-27-2009, 12:56 PM   #2 (permalink)
Registered Member
 
Join Date: Apr 2009
Location: michigan
Posts: 197
michelle is on a distinguished road
Default

Quote:
Originally Posted by haniar View Post
Hi,

I would like to read the GPS data (lat / lon) for a picture that has been selected by the user using UIImagePickerController.

Selecting the picture works but how can I access the geo data?

I have looked at iphone-exif (iphone-exif - Project Hosting on Google Code) project but it does not seem to work with UIImage.

Any suggestions

Thanks

I don't think you can, seems like the raw image in the private folder retains the exif but not after going through the imagepicker. Unfortunately if you try to access the private folder, almost for sure your app is going to get rejected.

My solution was to track the location info seperately storing the image in a seperate database. For me this was cleaner than playing with the exif data.

I suppose if your app is for add-hoc only you could use the private api, but anything go to the app store I wouldn't.

I think the exif-iphone project was intended to add the info back in, but that project is gpl license, which means you can't use it in your commerical app.

Last edited by michelle; 11-27-2009 at 12:59 PM.
michelle is offline   Reply With Quote
Old 11-16-2011, 03:10 AM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 1
kruptworld is on a distinguished road
Default iphone-exif

Quote:
Originally Posted by michelle View Post
I don't think you can, seems like the raw image in the private folder retains the exif but not after going through the imagepicker. Unfortunately if you try to access the private folder, almost for sure your app is going to get rejected.

My solution was to track the location info seperately storing the image in a seperate database. For me this was cleaner than playing with the exif data.

I suppose if your app is for add-hoc only you could use the private api, but anything go to the app store I wouldn't.

I think the exif-iphone project was intended to add the info back in, but that project is gpl license, which means you can't use it in your commerical app.
hey, how did you do it? im going nuts. i want to make an open source app which when a photo is taken and you upload it to my server an kml file is made from the geo tags in the photos. but when i upload photos from the uiimagepicker there is no tags in it, only photos taken with the native camera app. please help me out.
kruptworld is offline   Reply With Quote
Old 11-16-2011, 04:19 PM   #4 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 7
FoJjen is on a distinguished road
Default

remove....

Last edited by FoJjen; 11-16-2011 at 04:22 PM. Reason: Dubbel post
FoJjen is offline   Reply With Quote
Old 11-16-2011, 04:22 PM   #5 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 7
FoJjen is on a distinguished road
Default

i use...

Code:
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    if (popover) {
        [popover dismissPopoverAnimated:YES];
    }
    NSLog(@"imagePickerController");
    [picker dismissModalViewControllerAnimated:YES];
    
    ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
    if (picker.sourceType == UIImagePickerControllerSourceTypePhotoLibrary) {
        
        [assetslibrary assetForURL:[info objectForKey:UIImagePickerControllerReferenceURL]
                       resultBlock: ^(ALAsset *myasset) {
                           CLLocation *loc = ((CLLocation*)[myasset valueForProperty:ALAssetPropertyLocation]);
                           CLLocationCoordinate2D c = loc.coordinate;
                           
                           longitude = c.longitude;
                           latitude  = c.latitude;
                       }
                      failureBlock: ^(NSError *err) {
                          
                      }];
        
        
        [assetslibrary release];
..........
    }
FoJjen is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 362
8 members and 354 guests
.Snipe, BSH, givensur, guusleijsten, HemiMG, NSString, Paul Slocum, SillyHoney
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,645
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, leighec68
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:27 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0