Today, suddenly think of a friend circle to send photos, involving personal privacy is the location of the leak. Photos taken with the iphone will have location and other information. Let's first implement how to read the security information inside. And then we'll analyze it.
#import "ViewController.h" #import <ImageIO/ImageIO.h> #import <assetslibrary/assetslibrary.h>@ Interface Viewcontroller () <uiimagepickercontrollerdelegate,uinavigationcontrollerdelegate>@ End@implementation viewcontroller-(void) viewdidload {[Super viewdidload]; Create a Uiimagepickercontroller object Uiimagepickercontroller *ctrl = [[Uiimagepickercontroller alloc] init]; Set type Ctrl.sourcetype = Uiimagepickercontrollersourcetypephotolibrary; Set proxy ctrl.delegate = self; Show [self Presentviewcontroller:ctrl animated:yes completion:nil]; }-(void) Imagepickercontroller: (Uiimagepickercontroller *) Picker Didfinishpickingmediawithinfo: (NSDictionary *) info{if (Picker.sourcetype = = uiimagepickercontrollersourcetypephotolibrary) {//uiimage *image= [info ob Jectforkey:uiimagepickercontrolleroriginalimage]; Nsurl *asseturl = [info objectforkey:uiimagepickercontrollerreferenceurl]; Alassetslibrary *library = [[Alassetslibrary alloc] init]; [Library Assetforurl:asseturl resultblock:^ (Alasset *asset) {nsdictionary* Imagemetadata = [[Nsmutabledictionary alloc] InitWithDictionary:asset.defaultRepresent Ation.metadata]; Nsdictionary *gps = [Imagemetadata objectforkey: (NSString *) kcgimagepropertygpsdictionary]; NSLog (@ "--------%@", GPS),//Location information NSLog (@ "%@", imagemetadata); } failureblock:^ (Nserror *error) {}]; } }
After my investigation:
First the friend assumes with. Photos sent to you in the original form. is provided with geo-location information. You save it to the album and try it out using the code above.
Assumptions are not in the original form. Then the security information will be erased.
So generally sent to the circle of friends, Weibo on these social platforms.
Photos are not the original form, the location of these security information is not visible. Can be used with confidence.
I don't know if I can read the photo security information in the original form in some way. Let me know if you can tell me oh ...
IOS about image location Privacy Information analysis and Reading