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 = <f801d201 d801a801 1801b800 5d006e00 81006400 63006900 66006300 49005d00 e201dc01 2102ac01 b2007100 5a007d00 84006300 5f006b00 6a005b00 3e005300 d201f501 1f027e01 a4006600 7100a800 78006600 5f006b00 68005800 3f004e00 e9011502 f301a301 97006400 5000a900 7a006400 5d006a00 6b005500 3c005100 0f020d02 fb014c01 95005400 5200e400 c3009100 5d006700 6a005300 38004d00 1502cc01 af012701 1f016800 a2002e02 4301ac00 7d003100 41003f00 2d003700 cd01a401 af012101 b4007600 ec008601 ed00bf00 fd001f00 13002300 1d002400 6f019701 ad012201 a3006300 de00fa02 df01e700 2a001200 0f001000 12002300 4001a501 80012701 9b006100 8700d301 9e01e600 32002b00 4b005200 3b003100 2b016a01 53012c01 8a00ad00 89003002 67029901 3f000a00 12000c00 13003000 2f014b01 56011e01 84005500 ed001403 42022e02 49000c00 14002100 22002600 52019d01 49010901 76005200 7300c001 cb01e700 78003b00 48003d00 3c003f00 8e01a301 2b01ff00 62003600 72008200 7f006b00 61005500 5a005600 51005200 ac017c01 ff001501 6e003900 61008100 76006700 5c005100 55005a00 52004d00 db015f01 f9003401 c4004700 75008100 77006500 57005000 56005600 4f004c00 d6014f01 57014601 8b003e00 92008000 77006000 57005200 4f005700 52004b00>;

        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;

    };

}


猜你喜欢

转载自blog.csdn.net/yidu_blog/article/details/76615691