Hi everyone. A link or a bit of code would be much appreciated!
I have an app that lets users take photos. Here's the code I use to create the jpeg file.
How can I add a geo-tag to the photo's EXIF data, assuming the parameter info has a lat and lon?
- (void) saveImage:(NSDictionary*) info {
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *filePath = [self applicationDocumentsDirectory]
stringByAppendingString: @"/photos/"];
[fileManager createDirectoryAtPath: filePath withIntermediateDirectories: NO attributes: nil error: nil];
filePath = [filePath stringByAppendingString: [info objectForKey: @"title"]];
filePath = [filePath stringByAppendingString: @".jpg"];
[fileManager createFileAtPath:filePath contents:nil attributes:nil];
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:filePath];
NSData * imgData = [[NSData alloc] initWithData:
UIImageJPEGRepresentation([info objectForKey: @"image"],.8)];
[fileHandle writeData:imgData];
[fileHandle closeFile];
[imgData release];
}