alassetslibrary

iOS save photo in an app specific album

为君一笑 提交于 2019-11-27 03:36:20
I'm creating an iOS 5 app. I want to save a photo to the device. I want to save the photo to an album specific to my app, so I need to create the album, and then save photos to the album. I know how to create the album: ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; [library addAssetsGroupAlbumWithName:@"MY APP NAME" resultBlock:^(ALAssetsGroup *group) { //How to get the album URL? } failureBlock:^(NSError *error) { //Handle the error }]; I want add photos to the new album now, how do I do so? Sample code is greatly appreciated! You may use the following code just change the name

Generating custom thumbnail from ALAssetRepresentation

心不动则不痛 提交于 2019-11-27 01:23:09
问题 My main problem is i need to obtain a thumbnail for an ALAsset object. I tried a lot of solutions and searched stack overflow for days, all the solutions i found are not working for me due to these constraint: I can't use the default thumbnail because it's too little; I can't use the fullScreen or fullResolution image because i have a lot of images on screen; I can't use UIImage or UIImageView for resizing because those loads the fullResolution image I can't load the image in memory, i'm

iOS 8 Photos framework. Access photo metadata

旧巷老猫 提交于 2019-11-26 23:58:40
问题 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

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

99封情书 提交于 2019-11-26 20:28:00
问题 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

How to get an ALAsset URL from a PHAsset?

。_饼干妹妹 提交于 2019-11-26 18:58:37
You can do it sneakily† using the undocumented PHAsset.ALAssetURL property, but I'm looking for something documented. † In Objective-C, this will help @interface PHAsset (Sneaky) @property (nonatomic, readonly) NSURL *ALAssetURL; @end holtmann Create the assetURL by leveraging the localidentifier of the PHAsset . Example: PHAsset.localidentifier returns 91B1C271-C617-49CE-A074-E391BA7F843F/L0/001 Now take the 32 first characters to build the assetURL, like: assets-library://asset/asset.JPG?id=91B1C271-C617-49CE-A074-E391BA7F843F&ext=JPG You might change the extension JPG depending on the UTI

Unable to load image from asset URL

≯℡__Kan透↙ 提交于 2019-11-26 14:09:41
问题 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

Getting video from ALAsset

心已入冬 提交于 2019-11-26 12:57:16
问题 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

Save Photos to Custom Album in iPhones Photo Library

戏子无情 提交于 2019-11-26 11:51:13
问题 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

NSURL from PHAsset

牧云@^-^@ 提交于 2019-11-26 10:56:18
问题 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.

Write UIImage along with metadata (EXIF, GPS, TIFF) in iPhone's Photo library

喜你入骨 提交于 2019-11-26 08:19:20
问题 I am developing a project, where the requirements are: - User will open the camera through the application - Upon capturing an Image, some data will be appended to the captured image\'s metadata. I have gone through some of the forums. I tried to code this logic. I guess, I have reached to the point, but something is missing as I am not able to see the metadata that I am appending to the image. My code is: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage: