ios获取图片exif信息



[objc]  view plain  copy
  1. #include "AssetsLibrary/ALAssetsLibrary.h"  
  2. #include "AssetsLibrary/ALAssetRepresentation.h"  
[objc]  view plain  copy
  1. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {  
  2.     NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];  
  3.     ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)   {  
  4.         ALAssetRepresentation *representation = [myasset defaultRepresentation];  
  5.         NSLog(@"meta=%@",[representation metadata]);  
  6.           
  7.         NSString *fileName = [representation filename];  
  8.         NSLog(@"fileName : %@",fileName);  
  9.     };  
  10.       
  11.     ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init]  ;  
  12.     [assetslibrary assetForURL:imageURL  
  13.                    resultBlock:resultblock  
  14.                   failureBlock:nil];  
  15. }  

meta={

    ColorModel = RGB;

    DPIHeight = 72;

    DPIWidth = 72;

    Depth = 8;

    Orientation = 6;

    PixelHeight = 2448;

    PixelWidth = 3264;

    ProfileName = "sRGB IEC61966-2.1";

    "{ExifAux}" =     {

        Regions =         {

            HeightAppliedTo = 2448;

            RegionList =             (

                                {

                    AngleInfoRoll = 270;

                    AngleInfoYaw = 0;

                    ConfidenceLevel = 261;

                    FaceID = 12;

                    Height = "0.074755";

                    Timestamp = 2147483647;

                    Type = Face;

                    Width = "0.056066";

                    X = "0.399663";

                    Y = "0.587214";

                }

            );

            WidthAppliedTo = 3264;

        };

    };

    "{Exif}" =     {

        ApertureValue = "2.275007206687806";

        BrightnessValue = "10.71860465116279";

        ColorSpace = 1;

        ComponentsConfiguration =         (

            1,

            2,

            3,

            0

        );

        DateTimeDigitized = "2015:06:05 09:55:26";

        DateTimeOriginal = "2015:06:05 09:55:26";

        ExifVersion =         (

            2,

            2,

            1

        );

        ExposureBiasValue = 0;

        ExposureMode = 0;

        ExposureProgram = 2;

        ExposureTime = "0.0003409478349812479";

        FNumber = "2.2";

        Flash = 16;

        FlashPixVersion =         (

            1,

            0

        );

        FocalLenIn35mmFilm = 29;

        FocalLength = "4.15";

        ISOSpeedRatings =         (

            32

        );

        LensMake = Apple;

        LensModel = "iPhone 5s back camera 4.15mm f/2.2";

        LensSpecification =         (

            "4.15",

            "4.15",

            "2.2",

            "2.2"

        );

        MeteringMode = 5;

        PixelXDimension = 3264;

        PixelYDimension = 2448;

        SceneCaptureType = 0;

        SceneType = 1;

        SensingMethod = 2;

        ShutterSpeedValue = "11.5179407176287";

        SubjectArea =         (

            1301,

            1433,

            182,

            181

        );

        SubsecTimeDigitized = 905;

        SubsecTimeOriginal = 905;

        WhiteBalance = 0;

    };

    "{GPS}" =     {

        Altitude = "9.596343178621659";

        AltitudeRef = 0;

        DateStamp = "2015:06:05";

        DestBearing = "217.6901408450704";

        DestBearingRef = M;

        ImgDirection = "37.69015544041451";

        ImgDirectionRef = M;

        Latitude = "22.36720333333333";

        LatitudeRef = N;

        Longitude = "113.54242";

        LongitudeRef = E;

        Speed = 0;

        SpeedRef = K;

        TimeStamp = "01:55:26";

    };

    "{MakerApple}" =     {

        1 = 2;

        14 = 1;

        2 = ;

        3 =         {

            epoch = 0;

            flags = 1;

            timescale = 1000000000;

            value = 801371064569041;

        };

        4 = 1;

        5 = 186;

        6 = 180;

        7 = 1;

        8 =         (

            "-0.02023194",

            "-0.9834778",

            "-0.1565095"

        );

    };

    "{TIFF}" =     {

        DateTime = "2015:06:05 09:55:26";

        Make = Apple;

        Model = "iPhone 5s";

        Orientation = 6;

        ResolutionUnit = 2;

        Software = "8.3";

        XResolution = 72;

        YResolution = 72;

    };

}


你可能感兴趣的:(OC-方法,OC-类)