alassetslibrary

Wait for completion block of writeImageToSavedPhotosAlbum by semaphore

Deadly 提交于 2019-12-29 02:01: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

Replace ALAsset object in iOS ALAssetsLibrary

此生再无相见时 提交于 2019-12-24 02:37:26
问题 I am developing an application that reads the geo location of an image and allows the user to modify this information and write this data back. I successfully read the data, manipulate and write to the library by using writeImageDataToSavedPhotosAlbum function. The problem is that instead updating the original image, it creates a new one. How could i replace or update that item ? [...] NSMutableDictionary *EXIFDictionary = [[[metadata objectForKey:(NSString *)kCGImagePropertyExifDictionary

MonoTouch: Getting an Image out of ALAssetsLibrary.AssetForUrl

懵懂的女人 提交于 2019-12-23 10:44:03
问题 In MonoTouch: I am putting in an image from the Camera into the PhotoAlbum: ALAssetsLibrary library = new ALAssetsLibrary(); library.WriteImageToSavedPhotosAlbum(photo.CGImage, meta, (assetUrl, error) => { library.AssetForUrl(assetUrl, GotAsset, FailedGotAsset); }); The Photo is all there, works well. On the delegate GotAsset I am attempting to get out the image, but only the Thumbnail is there. Where is the image? void GotAsset(ALAsset asset) { //asset has only thumbnail info??? } Here's

MonoTouch: Getting an Image out of ALAssetsLibrary.AssetForUrl

只愿长相守 提交于 2019-12-23 10:39:50
问题 In MonoTouch: I am putting in an image from the Camera into the PhotoAlbum: ALAssetsLibrary library = new ALAssetsLibrary(); library.WriteImageToSavedPhotosAlbum(photo.CGImage, meta, (assetUrl, error) => { library.AssetForUrl(assetUrl, GotAsset, FailedGotAsset); }); The Photo is all there, works well. On the delegate GotAsset I am attempting to get out the image, but only the Thumbnail is there. Where is the image? void GotAsset(ALAsset asset) { //asset has only thumbnail info??? } Here's

ALAssetLibrary Notification and enumerateAssetsUsingBlock

若如初见. 提交于 2019-12-23 05:37:22
问题 I'm building an iOS app that allows a user to take a picture and save it to a custom album, which populates a UICollectionView in the app with the photos from the album. I found plenty of examples on the web on how to do this, but I could NOT get past a stubborn problem with the most recent picture not showing up in the album. I ended building a work around using notifications and a serial dispatch queue, but I think it can be improved. Here's how I'm saving the pictures and then repopulating

Force async tasks to run in sequence

半世苍凉 提交于 2019-12-23 04:23:20
问题 I'm saving images to photo library using ALAssetsLibrary . When when it gets in loop it runs simultaneously and causing memory problems. How can I run this without causing memory problems ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; for(UIImage *image in images){ [library writeImageToSavedPhotosAlbum:[image CGImage] orientation:(ALAssetOrientation)[image imageOrientation] completionBlock:^(NSURL *assetURL, NSError *error) { ... // }]; } 回答1: If you want to ensure that these

AlAssetLibrary returning empty results

天大地大妈咪最大 提交于 2019-12-23 03:19:09
问题 I'm trying to pick out some camera roll meta data. When I enumerate through the assets, I cannot seem to retrieve any information and get an empty array. Is there a step I'm missing? My code: assets = [[NSMutableArray array] init]; void (^assetEnumerator)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *asset, NSUInteger index, BOOL *stop) { if(asset != NULL) { [assets addObject:asset]; dispatch_async(dispatch_get_main_queue(), ^{ }); } }; void (^assetGroupEnumerator)(ALAssetsGroup *, BOOL *) = ^

Fast way of obtaining thumbnail from ALAsset with filtered applied

六眼飞鱼酱① 提交于 2019-12-22 11:09:39
问题 A prompt and convenient way of gererating thumbnails from an ALAsset is described in the answer to question "Generating custom thumbnail from ALAssetRepresentation" — see a blog post of the author. The only issue I have with this method is that it completely ignores all the filters or red-eye removal effects applied to an image (say one taken with stock iOS 7 Photo app + any filter in 'square' mode). How should the code be adjusted to return 'filtered' thumbnails? P.S. I know I can get

Open camera roll on an exact photo

女生的网名这么多〃 提交于 2019-12-22 08:22:58
问题 I'm developing a camera application where I'd like to put some functions that are already present in the stock app. My problem is replicating the little square in the bottom left corner (in portrait mode) where the micro-thumbnail of the photo that the user has just taken is shown; then, when the user tap on it, the photo app should open, on the last photo saved in the camera roll. I can load the thumbnail of the newest photo in camera roll with ALAssetsLibrary - I've access to it with

Meta data dictionary of UIImage does not got value for IPTC key

淺唱寂寞╮ 提交于 2019-12-22 01:07:59
问题 While saving screenshot image I am trying to change meta data of UIImage object for custom title and description of image. Imported headers #import <AssetsLibrary/AssetsLibrary.h> #import <ImageIO/ImageIO.h> #import <ImageIO/CGImageProperties.h> Inside my method NSData* dataOfImageFromGallery = UIImageJPEGRepresentation(imageToSave, 1.0); CGImageSourceRef imageSource = CGImageSourceCreateWithData((CFDataRef)dataOfImageFromGallery, NULL); NSMutableDictionary* metaData = (NSMutableDictionary *)