I have successfully added metadata to a jpg created within the app and saved it to the Camera Roll using the
writeImageToSavedPhotosAlbum: metadata: completionBlock:
method. However I would also like the option of emailing this jpg with the metadata (such as location, exit, etc.). I use this to email:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSData *myData = UIImageJPEGRepresentation(emailImage, 0.8);
[picker addAttachmentData:myData mimeType:@"image/jpg" fileName:@"photo"];
However, this results in no metadata.
When the saved image is sent via Apple's photo app, metadata is included.
Is there a way to embed the metadata into NSData attachment? Any ideas?