alassetslibrary

How to display all images from NSDocument directory

风流意气都作罢 提交于 2019-11-30 07:32:40
First i selected images from photo library to ALAsset Library and after that i stored images in document directory from ALAsset library path. i am using this code to store images in document directory from ALAsset Library.... Its working perfect... Now i want to display all images which are stored in document directory in table view.. how can i do this??? can anybody help me?? Code for importing images from ALAsset Library to NSdocument directory for (int j=0; j<[assetArray count]; j++) { ALAssetRepresentation *representation = [[assetArray objectAtIndex:j] defaultRepresentation]; NSString*

Photo taken with camera does not contain any ALAsset metadata

穿精又带淫゛_ 提交于 2019-11-30 07:20:56
The weirdest thing is happening. I have an action sheet which gives the user the choice to either take a photo with the camera or choose one from the camera roll. Upon the UIImagePicker returning from selection I use the ALAssetsLibrary to determine the GPS information embedded in the photo. Choosing a photo from the camera roll works perfectly and I am able to retrieve the GPS information. However, taking a photo with the camera provides absolutely no GPS information, in fact I have no metadata at all. Does anyone know what I'm doing wrong here? Code below: - (void)imagePickerController:

Saving Video in an Album Created

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 07:08:38
i have created an album using this code in AppDelegate methode NSString *albumName=@"999Videos"; ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library addAssetsGroupAlbumWithName:albumName resultBlock:^(ALAssetsGroup *group) { NSLog(@"added album:%@", albumName); } failureBlock:^(NSError *error) { NSLog(@"error adding album"); }]; Now i want to save the recorded videos to this 999Videos album created.Not to the photosAlbum which i have done like this. ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:outputFileURL]

iOS stopped asking user for Photo Library Permission

不羁岁月 提交于 2019-11-30 03:09:08
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 the app for the first time. Prior to this, there's no other event or screen that asks for the photos

Wait for assetForURL blocks to be completed

和自甴很熟 提交于 2019-11-29 20:28:14
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); // Try to load asset at mediaURL [library assetForURL:asseturl resultBlock:^(ALAsset *asset) { // If

Interpret XMP-Metadata in ALAssetRepresentation

南楼画角 提交于 2019-11-29 20:24:53
When a user makes some changes (cropping, red-eye removal, ...) to photos in the built-in Photos.app on iOS, the changes are not applied to the fullResolutionImage returned by the corresponding ALAssetRepresentation . However, the changes are applied to the thumbnail and the fullScreenImage returned by the ALAssetRepresentation . Furthermore, information about the applied changes can be found in the ALAssetRepresentation 's metadata dictionary via the key @"AdjustmentXMP" . I would like to apply these changes to the fullResolutionImage myself to preserve consistency. I've found out that on

ALAssetsLibrary getting the path of a video and play it later

自作多情 提交于 2019-11-29 15:43:47
问题 Using below code I am able to get the video files in tableview. But I am unable to get the path to the video so that I would save it and use it later to play. - (void)viewDidLoad { [super viewDidLoad]; [activity startAnimating]; assets = [[NSMutableArray alloc] init]; library = [[ALAssetsLibrary alloc] init]; UIImage *viewImage; [library writeImageToSavedPhotosAlbum:[viewImage CGImage] orientation:(ALAssetOrientation)[viewImage imageOrientation] completionBlock:^(NSURL *assetURL, NSError

How to get a correctly rotated UIImage from an ALAssetRepresentation?

a 夏天 提交于 2019-11-29 11:33:03
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 imageWithCGImage:scale:orientation: or initWithCGImage:scale:orientation: , passing the values of orientation

How to get NSData of mp3 using MPMediaPickerController?

十年热恋 提交于 2019-11-29 08:45:05
I want to upload mp3 from my phone to server, for this i am using MPMediaPickerController . After getting URL of MPMediaItem , i want to get NSData of this url , but i am getting null in NSData. - (void) mediaPicker: (MPMediaPickerController *) mediaPicker didPickMediaItems: (MPMediaItemCollection *) mediaItemCollection { [self dismissViewControllerAnimated:YES completion:nil]; MPMediaItem *item=[[mediaItemCollection items] objectAtIndex:0]; NSURL *url = [item valueForProperty: MPMediaItemPropertyAssetURL]; NSString *path = [NSString stringWithFormat:@"%@",url]; NSData *data = [[NSFileManager

Get URL of a newly created asset, iOS 9 style

為{幸葍}努か 提交于 2019-11-29 02:49:59
问题 ALAssetsLibrary is deprecated these days but practically all examples on SO are still making use of it. For my objective, I need to know the URL of the video that was added to the Photo Library so I could share a video to the Instagram app (that's the only way in which Instagram accepts videos). The URL should probably start with "assets-library://..." This is simple with ALAssetsLibrary : ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library writeVideoAtPathToSavedPhotosAlbum