内存从手机图库访问照片时出现问题

时间:2016-04-20 07:34:34

标签: ios objective-c image-size phasset

如何降低PHAsset图像的质量并检索图像的原始大小,因为它占用了大量内存?

PHImageManager *manager = [PHImageManager defaultManager];

__block UIImage *ima;
for (PHAsset *asset in phAssets) {
    // Do something with the asset

    [manager requestImageForAsset:asset
                       targetSize:CGSizeMake(250, 250)
                      contentMode:PHImageContentModeAspectFill
                          options:requestOptions
                    resultHandler:^void(UIImage *image, NSDictionary *info) {
                        ima = image;

                        [images addObject:ima];

                    }];
}

0 个答案:

没有答案