ios获取图片exif信息


#include "AssetsLibrary/ALAssetsLibrary.h"
#include "AssetsLibrary/ALAssetRepresentation.h"
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];
    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset)   {
        ALAssetRepresentation *representation = [myasset defaultRepresentation];
        NSLog(@"meta=%@",[representation metadata]);
        
        NSString *fileName = [representation filename];
        NSLog(@"fileName : %@",fileName);
    };
    
    ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init]  ;
    [assetslibrary assetForURL:imageURL
                   resultBlock:resultblock
                  failureBlock:nil];
}

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;

    };

}


  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
要在iOS开发中获取图片中二维码的定位,可以使用CoreImage框架。具体步骤如下: 1. 使用CIImage加载图片: ``` CIImage *image = [CIImage imageWithCGImage:image.CGImage]; ``` 2. 创建CIDetector并设置识别类型: ``` CIDetector *detector = [CIDetector detectorOfType:CIDetectorTypeQRCode context:nil options:@{CIDetectorAccuracy:CIDetectorAccuracyHigh}]; ``` 3. 识别二维码: ``` NSArray *features = [detector featuresInImage:image]; ``` 4. 遍历识别结果,获取二维码定位: ``` for (CIQRCodeFeature *feature in features) { NSArray *corners = feature.corners; // 获取定位四个角的坐标 // 在图像上绘制定位 UIGraphicsBeginImageContext(imageSize); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetStrokeColorWithColor(context, [UIColor greenColor].CGColor); CGContextSetLineWidth(context, 2.0); CGContextMoveToPoint(context, corners[0].x, corners[0].y); CGContextAddLineToPoint(context, corners[1].x, corners[1].y); CGContextAddLineToPoint(context, corners[2].x, corners[2].y); CGContextAddLineToPoint(context, corners[3].x, corners[3].y); CGContextAddLineToPoint(context, corners[0].x, corners[0].y); CGContextStrokePath(context); UIImage *resultImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); } ``` 这样就可以在原图上绘制出二维码的定位了。需要注意的是,CIDetector只能识别二维码,如果要识别其他类型的码,需要设置不同的detector类型。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值