- (void)getImagesFromPhotoLibrary{
void (^assetsEnumeration)(ALAsset *,NSUInteger,BOOL *) = ^(ALAsset *asset,NSUInteger index,BOOL *stop){
if(asset!=nil)
{
NSLog(@"obtained Asset %@",[asset valueForProperty:ALAssetPropertyURLs]);
[self.dataContainer addObject:asset];
NSLog(@"assest...%@",asset);
[self setImage];
}
NSLog(@"data container...%@",self.dataContainer);
};
void (^assetsGroupEnumeration)(ALAssetsGroup *,BOOL *) = ^(ALAssetsGroup *group,BOOL *status){
if(group!=nil)
{
[group enumerateAssetsUsingBlock:assetsEnumeration];
}
};
// allocate the library
library = [[ALAssetsLibrary alloc]init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll usingBlock:assetsGroupEnumeration failureBlock:^(NSError *error) {
NSLog(@"Error :%@", [error localizedDescription]);
}];
}
Set Image:-
[imageview.image setImage:[UIImage imageWithCGImage:[(ALAsset*)[dataContainer objectAtIndex:indexPath ]thumbnail]]];
it have retrive only thumbnail of the image how to get the original image.
ReplyDeleteHello Friend
DeleteHere i m sharing code of getting original image from library :-
ALAssetRepresentation *rep = [[dataContainer objectAtIndex:indexPath+1] defaultRepresentation];
CGImageRef iref = [rep fullResolutionImage];
if (iref) {
UIImage *image = [UIImage imageWithCGImage:iref];
}
You've made some good points there. I looked on the web to find out moree about the issue and found most individuals
ReplyDeletewill go along with your views on thiss website.
Take a look at my homepage :: Beats By Dre Wireless
I am sure this article has touched all the internet visitors,
ReplyDeleteitts really really fastidious piece off writing on building up new webpage.
my web-site - beats bby dr dre white (http://keylimeshop.com/outlet?beats=beats-by-dr-dre-white.php)