UIImagePickerController获取图片详细信息

透过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];

你可能感兴趣的:(UIImagePickerController获取图片详细信息)