alassetslibrary

Possible ways to speed up reading from ALAssetsLibrary and populating a UITableView

孤人 提交于 2019-12-05 07:55:23
问题 Right now, I am using the ALAssetsLibrary to gather the photos from ALAssetsGroupSavedPhotos and ALAssetsGroupLibrary. Upon reading all the assets into an array, I populate my UITableView ([myTable reloadData]) to show the photos. I find that if the user has many photos, there is an increasing amount of delay. Is there any way to possible speed things up? The default UIIMagePicker seems to have no delay at all, despite the number of photos in the Camera Roll or PhotoLibrary. Is there any way

How to enumerate all photos on iOS 8 using ALAssetsLibrary

半世苍凉 提交于 2019-12-05 04:42:52
iOS 8 broke lots of apps by removing "Camera Roll" from the ALAssetsLibrary enumerating API. I know I can get all photos using the new Photos framework. But my app has a lot of code depending on ALAsset related classes and I need to keep iOS 7 support. Is there a way to enumerate all photos using ALAssetsLibary on iOS 8, without enumerating asset group first? Apple just released 8.0.1 and listed this as a included fix. Might just be best to wait for that. From the 8.0.1 release notes: Fixes an issue that prevented some apps from accessing photos from the Photo Library 来源: https://stackoverflow

UIImagePickerControllerOriginalImage vs original asset data

China☆狼群 提交于 2019-12-05 02:57:51
In the app that I am developing, I am using an image that a user chooses from their photo albums. I need to upload a hi-res version of that photo to my server. I'm using imagePickerController and I've determined that I have 2 options use UIImage from UIImagePickerControllerOriginalImage get original asset by using UIImagePickerControllerReferenceURL and ALAssetsLibrary assetForURL (I don't like this because it prompts the user to use their current location, which I don't need) My question is... Is there any difference in the quality of the image if I use the first option vs the second? -(void

Correct way to transition between collection view and paged detail view

主宰稳场 提交于 2019-12-05 02:40:26
问题 Currently I have a uicollection view which displays a specific album in the users photos, (ALAssets library). In my mainView.m I gather the pictures: + (ALAssetsLibrary *)defaultAssetsLibrary { static dispatch_once_t pred = 0; static ALAssetsLibrary *library = nil; dispatch_once(&pred, ^{ library = [[ALAssetsLibrary alloc] init]; }); return library; } - (void)beginLoadingPhotoInfo { ... [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:assetGroupEnumerator failureBlock:^

Asset Library issue in iOS - 5

被刻印的时光 ゝ 提交于 2019-12-04 21:42:04
i am using asset library for getting image from url , my code is ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset){ ALAssetRepresentation *rep = [myasset defaultRepresentation]; CGImageRef iref = [rep fullResolutionImage]; UIImage *largeimage; if (iref) { largeimage = [UIImage imageWithCGImage:iref]; } [self customeButtonCreated:self]; NSData* thumbImageData = [[NSData alloc] initWithContentsOfFile:imagePath]; btn1.frame = CGRectMake(x, y, WIDTH, HEIGHT); [btn1 setTag:tag]; //[media_id addObject:[allKey objectAtIndex:0]]; [btnURl addObject:imagePath]; UIImage *tempImage =

iOS showing Image from ALAsset in UITableView

夙愿已清 提交于 2019-12-04 21:03:32
I have a db where items are stored. These items can be different kinds of type like text, videos and images. When the View is loaded I fetch these items from the DB and I show them in a UITableView. The problem I am facing is related to show the images in the table view. Basically in the DB I store the ALAsset link related to the picture and from it I try to get its image using this code: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //...Other Code else if ([object isMemberOfClass:[Picture class]]){ //Get a reusable cell cell =

Meta data dictionary of UIImage does not got value for IPTC key

狂风中的少年 提交于 2019-12-04 20:43:38
While saving screenshot image I am trying to change meta data of UIImage object for custom title and description of image. Imported headers #import <AssetsLibrary/AssetsLibrary.h> #import <ImageIO/ImageIO.h> #import <ImageIO/CGImageProperties.h> Inside my method NSData* dataOfImageFromGallery = UIImageJPEGRepresentation(imageToSave, 1.0); CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)dataOfImageFromGallery, NULL); NSMutableDictionary* metaData = (NSMutableDictionary *) CFBridgingRelease(CGImageSourceCopyPropertiesAtIndex(imageSource,0,NULL)); //--> metaData dictionary

ALAssetsLibrary is too slow - Objective-C

帅比萌擦擦* 提交于 2019-12-04 14:28:12
问题 What is a fast way to load 10-20 fullscreen images from a camera roll, saved photos? I'm using this code, but to load 10 photos I need to wait about 5-10 seconds. I'm using iPhone 4S. ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library enumerateGroupsWithTypes:ALAssetsGroupSavedPhotos usingBlock:^(ALAssetsGroup *group, BOOL *stop) { if(_savedPhotos.count>=11) *stop = YES; [group enumerateAssetsWithOptions:NSEnumerationReverse usingBlock:^(ALAsset *result, NSUInteger index,

How to copy an image file from iOS Photo Library (ALAssetsLibrary) to the local directory of an App?

旧城冷巷雨未停 提交于 2019-12-04 11:34:51
I can get images from Photo Library through ALAssetsLibrary: void (^assetEnumerator)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){ if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypePhoto]) { // Copy the photo image to the `/Documents` directory of this App here } }; void (^assetGroupEnumerator )(ALAssetsGroup*, BOOL*) = ^(ALAssetsGroup *group, BOOL *stop){ if (group != nil) { [group enumerateAssetsUsingBlock:assetEnumerator]; } }; // fetch ALAssetsLibrary *library = [ALAssetsLibrary new]; [library enumerateGroupsWithTypes

How do i get only the videos using ALAssetsLibrary

青春壹個敷衍的年華 提交于 2019-12-04 05:09:16
I am trying to get videos present from the photo library from the following piece of code.But i also get images list.How do i get list of all videos? what am i doing wrong? NSMutableArray* assetURLDictionaries = [[NSMutableArray alloc] init]; xy =[[NSMutableArray alloc]init]; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; void (^assetEnumerator)( ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop) { if(result != nil) { if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypeVideo]) { [assetURLDictionaries addObject:[result