根据ALSeet的URL,获取相册中图片的原图
2018-03-17 本文已影响0人
柚子姑娘666
ALAssetsLibrary * lib = [[ALAssetsLibrary alloc] init];
[lib assetForURL:assets.assetPropertyURL resultBlock:^(ALAsset *asset){
//在这里使用asset来获取原图
ALAssetRepresentation *assetRep = [asset defaultRepresentation];
CGImageRef imgRef = [assetRep fullResolutionImage];
UIImage *img = [UIImage imageWithCGImage:imgRef scale:assetRep.scale orientation:(UIImageOrientation)assetRep.orientation];
//assets.photo = img;//这里是原图
}
failureBlock:^(NSError *error){
}];