alassetslibrary

How to use PHPhotoLibrary like ALAssetsLibrary

余生长醉 提交于 2019-11-29 01:46:23
For iOS9, ALAssetsLibrary is deprecated. So how to change it as PHPPhotoLibrary instead of ALAssets ? if (RecordedSuccessfully && recording == NO) { //----- RECORDED SUCESSFULLY ----- NSLog(@"didFinishRecordingToOutputFileAtURL - success"); ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL]) { [library writeVideoAtPathToSavedPhotosAlbum:outputFileURL completionBlock:^(NSURL *assetURL, NSError *error) { if (error) { } }]; } // i have tried this, but didnt work [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{

iOS stopped asking user for Photo Library Permission

Deadly 提交于 2019-11-29 00:47:13
问题 iOS is not asking user for Photo Library Permission anymore. Even when I deleted the app from the device. This also happens on Simulator. switch ([ALAssetsLibrary authorizationStatus]) { case ALAuthorizationStatusAuthorized: RPMLog(@"authorized"); break; case ALAuthorizationStatusDenied: RPMLog(@"denied"); break; case ALAuthorizationStatusNotDetermined: RPMLog(@"not determined"); break; case ALAuthorizationStatusRestricted: RPMLog(@"restricted"); break; } I'm already authorized when I install

ALAssetsLibrary assetForURL: always returning nil for photos in “My Photo Stream” in iOS 8.1

浪子不回头ぞ 提交于 2019-11-28 17:53:50
This code worked fine in iOS 7 but in iOS 8.1 all assets located in the "My Photo Stream" album are nil from within the result block. (The failureBlock is not called.) Regular albums and shared albums work just fine. I tried the accepted answer from: Error trying to assigning __block ALAsset from inside assetForURL:resultBlock: That is, I'm holding a reference to an ALAssetsLibrary object, listening for the ALAssetsLibraryChangedNotification event (which doesn't happen btw, but oh well.) I made sure my app has permission to access photos, I'm on wi-fi, I see the photos' thumbnails just fine in

Wait for assetForURL blocks to be completed

笑着哭i 提交于 2019-11-28 17:08:03
问题 I would like to wait this code to be executed before to continue but as these blocks are called assynchronously I don't know how to do??? NSURL *asseturl; NSMutableArray *tmpListAsset = [[NSMutableArray alloc] init]; ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease]; NSMutableArray *objectsToRemove = [[NSMutableArray alloc] init]; for (NSDictionary *dico in assetsList) { asseturl = [NSURL URLWithString:[dico objectForKey:@"assetUrl"]]; NSLog(@"asset url %@", asseturl); /

Wait for completion block of writeImageToSavedPhotosAlbum by semaphore

て烟熏妆下的殇ゞ 提交于 2019-11-28 14:36:11
In my app I open the camera by a picker and after the photo has been taken I'd like to safe it by the following method the assets library. The method freezes after the call of the writeImageToSavedPhotosAlbum. Without the semaphores the methods work perfectly. But than I miss to receive the assetURL. + (NSURL*)safeImageToAssetsLibrary:(UIImage *)image metadata:(NSDictionary *)metadata { ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; __block NSURL *retAssestURL = nil; dispatch_semaphore_t semaWaitingForSafeImage = dispatch_semaphore_create(0); dispatch_queue_t queue = dispatch_get

How to fetch images from photo library within range of two dates in iOS?

荒凉一梦 提交于 2019-11-28 13:08:16
Context I am try to fetch images within range of two dates from the photo library. Firstly, I am getting info of the photo library images one by one in the dictionary form and picking every image date by using key and comparing that date with two dates by using if condition. If that image's date lies between the two dates, I insert that image into array. I am Saving images in array because I would like to show them in a collection view. Problem While it is working on simulator, it is not working on real device because of memory issues. I think there are bunch of images in the real device photo

NSBlockOperation or NSOperation with ALAsset Block to display photo-library images using ALAsset URL

半城伤御伤魂 提交于 2019-11-28 11:46:46
I am asking this question regarding my questions Display photolibrary images in an effectual way iPhone and Highly efficient UITableView "cellForRowIndexPath" method to bind the PhotoLibrary images . So I would like to request that answers are not duplicated to this one without reading the below details :) Let's come to the issue, I have researched detailed about my above mentioned issue, and I have found the document about operation queues from here . So I have created one sample application to display seven photo-library images using operation queues through ALAsset blocks. Here are the

ALAssetsLibrary delete ALAssetsGroup / ALAsset

烂漫一生 提交于 2019-11-28 09:26:45
I have created "photos album" from my App, using IOS AssetsLibrary. Reading ALAssetsLibrary,ALAssetsGroup and ALAsset documentations, i have seen methods to "addAsset","addAssetsGroupAlbumWithName". Is there a way to delete PROGRAMMATICALLY my ALAssetsGroup and ALAsset. (the property 'editable' suppose to be TRUE because i create this data). This is not possible using any documented API. Only the photos app can delete Albums. If you want this feature to be added to iOS, I would fill a feature request at http://radar.apple.com . You can only delete the ALAsset which is created by your app with

iPhone ALAssetsLibrary get all images and edit

家住魔仙堡 提交于 2019-11-28 06:09:37
问题 please help me with my question: Can I give URLs and metadata for all the images/videos in iPhone library with ALAssetsLibrary? Can I edit/delete these images/videos? 回答1: Take a look at the documentation for ALAssetsLibrary here. To access all photos and videos you need to enumerate all groups (albums) in the photo library and then enumerate all photos and images in each group. You cannot delete assets using the API. iOS 5 adds extra functionality - it's still under NDA though and cannot be

How to get a correctly rotated UIImage from an ALAssetRepresentation?

半城伤御伤魂 提交于 2019-11-28 04:37:54
问题 I’m trying to get a correctly rotated UIImage from an ALAssetRepresentation using the fullScreenImage method. I have several testing photos shot in various device orientations; the photos show up correctly in the Photos app. The documentation for fullScreenImage says: In iOS 5 and later, this method returns a fully cropped, rotated, and adjusted image—exactly as a user would see in Photos or in the image picker. To create a correctly-rotated UIImage object from the CGImage , you use