美文网首页
UIImagePickerController获取图片详细信息

UIImagePickerController获取图片详细信息

作者: 真爱要有你才完美 | 来源:发表于2017-11-28 14:42 被阅读16次

透过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获取图片详细信息

      本文链接:https://www.haomeiwen.com/subject/rotebxtx.html