透过UIImagePickerController,获取图片名字、唯一标示UTI、路径url
[objc]view plaincopy
NSURL*imageURL = [infovalueForKey:UIImagePickerControllerReferenceURL];
[selfgetImageDetailInfo:imageURL];
//获取图片的详细信息
-(void)getImageDetailInfo:(NSURL*)imageUrl{
__block NSString* imageFileName;
ALAssetsLibrary* assetslibrary = [[ALAssetsLibraryalloc]init];
[assetslibraryassetForURL:imageUrl
resultBlock:^(ALAsset*myasset){
ALAssetRepresentation*representation = [myassetdefaultRepresentation];
imageFileName = [representationfilename];
NSLog(@"图片路径名:%@",imageFileName);
NSLog(@"图片UTI:%@",[representationUTI]);
NSLog(@"图片URL:%@",[representationurl]);
}
failureBlock:nil];
网友评论