IOS about image location Privacy Information analysis and Reading

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.