alassetslibrary

iOS 8 Photos framework. Access photo metadata

时间秒杀一切 提交于 2019-11-28 03:12:47
I'm looking at replacing ALAssetsLibrary with Photos framework in my app. I can retrieve photos, collections, and asset sources just fine (even write them back out), but don't see anywhere to access the metadata of the photos (the dictionaries such as {Exif}, {TIFF}, {GPS}, etc...). ALAssetsLibrary has a way. UIImagePickerController has a way. Photos must have a way too. I see that PHAsset has a location property which will do for the GPS dictionary, but I'm looking to access all of the metadata which include faces, orientation, exposure, ISO, and tons more. Currently apple is at beta 2.

How to get NSData of mp3 using MPMediaPickerController?

。_饼干妹妹 提交于 2019-11-28 02:06:51
问题 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:

How to get a photo's original filename in iOS?

有些话、适合烂在心里 提交于 2019-11-27 20:40:43
I'm currently developing an iPad app where a user will enter a photo filename in a text field (as part of field notes), then later they will import their photos to the iPad's photo library. The app will access the library using ALAssetsLibrary and enumerate over the photos, looking for ones with the filename they entered in their field notes. This would be the filename given to the photo by the camera that took it. For example "DSC_0019.JPG". Is this not possible? I noticed that if I import photos from my camera to iPad, then open iPhoto on my Mac and look at the iPad as a camera, I can "get

How to check if an ALAsset still exists using a URL

不问归期 提交于 2019-11-27 20:15:48
I've got an array containing ALAsset urls (not full ALAsset objects) So each time I start my application I want to check my array to see if it's still up to date... So I tried NSData *assetData = [[NSData alloc] initWithContentsOfFile:@"assets-library://asset/asset.PNG?id=1000000001&ext=PNG"]; but assetData is allways nil thx for the help Use assetForURL:resultBlock:failureBlock: method of ALAssetsLibrary instead to get the asset from its URL. // Create assets library ALAssetsLibrary *library = [[[ALAssetsLibrary alloc] init] autorelease]; // Try to load asset at mediaURL [library assetForURL

How to use PHPhotoLibrary like ALAssetsLibrary

好久不见. 提交于 2019-11-27 16:14:17
问题 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)

Unable to load image from asset URL

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 08:30:54
I have a class that stores information about the assets on the phone (images, videos). My class has the ResourceURLString defined as such @property NSURL *ResourceURL; I am setting the property while looping trough the assets on the phone as such Item.ResourceURLString = [[asset valueForProperty:ALAssetPropertyURLs] objectForKey:[[asset valueForProperty:ALAssetPropertyRepresentations] objectAtIndex:0]]; When the user clicks on an image I want to load the image. The code that I have is this NSData *imageUrl = [NSData dataWithContentsOfURL:[NSURL URLWithString:[CurrentItem.ResourceURL

Getting video from ALAsset

*爱你&永不变心* 提交于 2019-11-27 06:56:10
Using the new asset library framework available in iOS 4 i see that I can get the url for a given video using the UIImagePickerControllerReferenceURL. The url returned is in the following format: assets-library://asset/asset.M4V?id=1000000004&ext=M4V I am trying to upload this video to a website so as a quick proof of concept I am trying the following NSData *data = [NSData dataWithContentsOfURL:videourl]; [data writeToFile:tmpfile atomically:NO]; Data is never initialized in this case. Has anyone managed to access the url directly via the new assets library? Thanks for your help. Here is a

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

血红的双手。 提交于 2019-11-27 06:29:28
问题 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

Save Photos to Custom Album in iPhones Photo Library

冷暖自知 提交于 2019-11-27 06:03:14
I'm trying to create a custom album in the Photo Library of an iPhone and then save photos that I've taken with the camera, or chosen from the phones Camera Roll to that custom album. I can successfully create the album but the photos are not getting saved there, instead they are getting saved to the simulators Saved Photos album... I'm not sure how to tell UIImageWriteToSavedPhotosAlbum to save to the new album I've just created using addAssetsGroupAlbumWithName ... Here is the code I have so far - I've snipped out a few sections to keep my code example short... - (void)imagePickerController:

NSURL from PHAsset

巧了我就是萌 提交于 2019-11-27 03:49:31
I'm converting our app over to use the Photos Framework of iOS8, the ALAsset framework is clearly a second class citizen under iOS8. I'm having a problem is that our architecture really wants an NSURL that represents the location of the media on "disk." We use this to upload the media to our servers for further processing. This was easy with ALAsset: ALAssetRepresentation *rep = [asset defaultRepresentation]; self.originalVideo = rep.url; But I'm just not seeing this ability in PHAsset. I guess I can call: imageManager.requestImageDataForAsset and then write it out to a temp spot in the file