0

我有这段代码用于检索图像并将其添加到数组中:

//Set the size of the video to 1280x720
        CGSize targetSize = CGSizeMake(1280, 720);
        PHImageRequestOptions *options = [[PHImageRequestOptions alloc]init];
        options.synchronous = YES;
        PHImageManager *manager = [[PHImageManager alloc]init];
        for (PHAsset *asset in self.assetsToVideofy){
            [manager requestImageForAsset:asset
                               targetSize:targetSize
                              contentMode:PHImageContentModeAspectFit
                                  options:options
                            resultHandler:^(UIImage *result, NSDictionary *info) {
                if (result) {
                    [self.photosToVideofy addObject:result];

                }
            }];

问题是图像仅作为缩略图添加。如何确保图像以 targetSize 加载然后添加到数组中?

谢谢

4

1 回答 1

1

尝试更改为:

if (result) {
    if (info[PHImageResultIsDegradedKey].boolValue == NO) {
        [self.photosToVideofy addObject:result];
    }
}
于 2014-10-29T01:14:09.007 回答