Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS Email sending photos strips GPS Data but not the iOS Email App
    primarykey
    data
    text
    <p>Using the </p> <pre><code>MFMailComposeViewController </code></pre> <p>and attaching an image with GPS coords (taken on the iOS device with camera) like:</p> <pre><code>UIImage* image = [info objectForKey:UIImagePickerControllerOriginalImage]; NSData* data = UIImageJPEGRepresentation(image, 1.0); [self.mailer addAttachmentData:data mimeType:@"image/jpeg" fileName:@"testimagesent.jpg"]; </code></pre> <p>is not "including" the GPS data with the email send.</p> <p>But, if the same file is sent using the iOS email application the GPS information is being sent. </p> <p>Any clue on why this is happening and / or a way to fix this, setting on the MFMail, ??? </p> <p>[Addition]</p> <p>After playing around with this a bit, if the image is part of the main bundle of the app, the metadata is included with the image on the email attachment. </p> <pre><code>NSString *photoFilePath = [[NSBundle mainBundle] pathForResource:@"testimage" ofType:@"jpg"]; NSData *data = [NSData dataWithContentsOfFile:photoFilePath]; [self.mailer addAttachmentData:data mimeType:@"image/jpeg" fileName:@"testimagesent.jpg"]; </code></pre> <p>If the image is not part of the main bundle (from photopicker, etc) the data is not part of the attachment. </p> <p>Will be playing arounds a bit, but this is looking like some sort of Apple privacy issue on sending a photo via an application email?</p> <p>[Addition2]</p> <p>It looks like it is boiling down to the statement</p> <pre><code>CGImageDestinationAddImageFromSource(destination,source,0, (__bridge CFDictionaryRef) metadataAsMutable); </code></pre> <p>Is not adding the metadata if the image is from the library. This is strange and not accepted 100%, but the code looks good and is adding / changing for a bundled image file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload