alassetslibrary

Delete an asset (picture or video) from IPhone in IOS

扶醉桌前 提交于 2019-12-03 03:00:35
I am working on an Iphone app and I can enumerate assets using the Assetslibrary and load them into a table view. The user can delete a row (a picture / video) in the app but how do I UPDATE the Iphone photo album directly from my app? Otherwise on refreshing, the tableview will reload the previously deleted asset. rsswtmr Possible duplication of https://stackoverflow.com/a/11058934/300292 . Simple answer: you can't. The Photos app is the only place you can delete assets. Which is probably a good thing--you wouldn't want any willy-nilly app to be able to delete all your photos, would you? Ted

How to Localize NSPhotoLibraryUsageDescription key (ALAssets)

余生颓废 提交于 2019-12-03 01:23:55
I'm trying to localize the NSPhotoLibraryUsageDescription key defined in the application's info.plist file ( reference here ). This key gives you a point to provide custom message when the app is first asking for access to your camera roll. I'm using ALAssetsLibrary to enumerate assets groups (which triggers the access request message to pop-up). So far my googling doesn't answer how I could achieve this. I want to avoid localizing the whole info.plist file as it contain a lot more non-locale dependent content. Anyone already solved this or have hints how to proceed? Joe Licari There is a file

Orientation does not behave correctly with Photo in ALAsset

假如想象 提交于 2019-12-02 23:03:55
I current have an app that uses ALAsssetsLibrary to fetch the photos. I have placed the photo to an image view and I am able to upload to the server. When I tested on the real device after taking some photos, I found out the photos that supposed to be taken in Portrait become a landscape. Therefore, I called different function to get the CGImage like this: UIImage *image = [UIImage imageWithCGImage:[representation fullResolutionImage] scale:1.0 orientation:(UIImageOrientation)[representation orientation]]; The first tried out, I used this : UIImage *image = [UIImage imageWithCGImage:

Save video to custom album in camera roll

人盡茶涼 提交于 2019-12-02 20:06:16
问题 I am able to save an image into a custom album in the iPhone camera roll. For example, the album name could be "Fun", and all of the images I take will go into that folder. I came across a helper class here that works very well to accomplish what I want. However, the method I am using does not save videos into the custom folder, but the folder is created - it's just empty of any videos that I attempt to save there. I tried debugging it with no progress. That method is here: -(void)addAssetURL

Replacing ALAssertLibrary to get the filename

元气小坏坏 提交于 2019-12-02 14:49:28
问题 Im using the following code to access filename of the image that I gotta upload. I need both filename alongside the file path and size. ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *imageAsset) { ALAssetRepresentation *imageRep = [imageAsset defaultRepresentation]; NSLog(@"[imageRep filename] : %@", [imageRep filename]); [_imageNameArray addObject:[imageRep filename]]; }; [_uploadTbleView reloadData]; ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];

Save video to custom album in camera roll

假装没事ソ 提交于 2019-12-02 12:01:57
I am able to save an image into a custom album in the iPhone camera roll. For example, the album name could be "Fun", and all of the images I take will go into that folder. I came across a helper class here that works very well to accomplish what I want. However, the method I am using does not save videos into the custom folder, but the folder is created - it's just empty of any videos that I attempt to save there. I tried debugging it with no progress. That method is here: -(void)addAssetURL:(NSURL*)assetURL toAlbum:(NSString*)albumName withCompletionBlock:(SaveImageCompletion)completionBlock

Is it possible to access a photo's geotag metadata from within the simulator?

一个人想着一个人 提交于 2019-12-02 10:18:58
问题 I've written an app that retrieves a photo's GPS metadata, and it works on my iPhone but doesn't in the simulator. If I drag a photo containing geotags onto the simulator, it gets placed into the photo library. Then, my app issues this code: ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; NSDictionary *metadata = [assetRepresentation metadata]; and metadata contains all sorts of items, but not GPS. Is there some trick to getting the simulator to recognize GPS

Get number of images in Photos.app?

一笑奈何 提交于 2019-12-02 09:33:06
问题 I know it's possible to get the images in the Photos.app by using ALAssetsLibrary but how do I get the total number of photos in Photos.app? Pretty much I am trying to check the number of photos because I am getting the last image in the Photos.app with the code from this question: Get last image from Photos.app? So if there's 0 images on the device, it won't execute the code from the link above. Anyway how can I get this? Thanks! 回答1: With the new Photos framework, introduced in iOS 8, you

Is it possible to access a photo's geotag metadata from within the simulator?

巧了我就是萌 提交于 2019-12-02 03:50:52
I've written an app that retrieves a photo's GPS metadata, and it works on my iPhone but doesn't in the simulator. If I drag a photo containing geotags onto the simulator, it gets placed into the photo library. Then, my app issues this code: ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; NSDictionary *metadata = [assetRepresentation metadata]; and metadata contains all sorts of items, but not GPS. Is there some trick to getting the simulator to recognize GPS metadata? Alternatively, what I'm trying to do is run the app in the simulator as many different devices to

How to get all photos moment wise using ALAssetLibrary in ios7?

烈酒焚心 提交于 2019-12-01 23:41:10
问题 I have problem to get photos in moment wise like apple iphone have in ios8. I have implemented for ios8 using PHAsset and Photos.framework. Now, when i run same code in ios7 device then it returns nothing. So, i go with ALAssetLibrary to get photos. Using ALAssetLibrary i also got all photos but that are like albums wise photos. and also using this ALAssetLibrary i cannot get album creation date not its location name, as i have to show this to data on my each section's header. My code for