how to detect if image from photo library was taken by iPhone camera or imported

in the app i am developing, i ought to know if the picture selected by the user was originally taken by the iPhone's camera, or is it a picture taken from any other source, as from the internet or imported from external camera etc.

Answers


As @yoeriboven pointed out, you should check the image EXIF. The easiest way to access it would be:

ALAssetRepresentation *assetRep = [asset defaultRepresentation];
NSDictionary *metaData = [assetRep metadata];

This should be the relevant section:

"{TIFF}" = {
    DateTime = "2012:12:13 01:21:55";
    Make = Apple;
    Model = "iPhone 4";
    Orientation = 6;
    ResolutionUnit = 2;
    Software = "6.0.1";
    XResolution = 72;
    YResolution = 72;
    "_YCbCrPositioning" = 1;
};

I wouldn't count only on the location property. Non iPhone photos can have location as well.


Need Your Help

How to access Quick Access tool bar command `Add to Quick Access Tool` if source binding applicable

c# wpf ribboncontrolslibrary

How can I add Quick Access Item container default by RibbonLibrary if I have binded collection for it. Its throws Operation is not valid while ItemSource is in use while is I add Quick Access tool ...

Flash: Accessing private files from Amazon S3

flash security amazon-s3

I have flash (AIR) application running on a single controlled system (there is only one computer running it and nobody has access to it).