alasset

ALAsset valueForProperty:ALAssetPropertyLocation undeclared?

醉酒当歌 提交于 2019-12-23 01:07:13
问题 This might seem too easy or maybe it's just confusing for me... Or maybe I'm too tired to think rationally. I am trying to get the location of an UIImage that has been selected by the user from the photo album using imagePickerController. - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *pic = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSData *data = UIImageJPEGRepresentation(pic, 0.01f); UIImage

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

Set Maximum Size for CGImageRef from ALAssetRepresentation

自古美人都是妖i 提交于 2019-12-22 11:00:32
问题 I am currently using the following code to get an UIImage from an ALAsset in an iOS app. ALAssetRepresentation *rep = [self.asset defaultRepresentation]; CGImageRef ref = [rep fullResolutionImage]; ALAssetOrientation orientation = [[self.asset valueForProperty:@"ALAssetPropertyOrientation"] intValue]; UIImage *image = [UIImage imageWithCGImage:ref scale:1.0 orientation:(UIImageOrientation)orientation]; This works very well as long as the image is reasonably small (e.g. taken with the device's

How to copy an image file from iOS Photo Library (ALAssetsLibrary) to the local directory of an App?

余生颓废 提交于 2019-12-21 17:56:28
问题 I can get images from Photo Library through ALAssetsLibrary: void (^assetEnumerator)(ALAsset *, NSUInteger, BOOL *) = ^(ALAsset *result, NSUInteger index, BOOL *stop){ if([[result valueForProperty:ALAssetPropertyType] isEqualToString:ALAssetTypePhoto]) { // Copy the photo image to the `/Documents` directory of this App here } }; void (^assetGroupEnumerator )(ALAssetsGroup*, BOOL*) = ^(ALAssetsGroup *group, BOOL *stop){ if (group != nil) { [group enumerateAssetsUsingBlock:assetEnumerator]; } }

How do I get a thumbnail or saveable path from UIImagePickerController to use for a UIImageView?

℡╲_俬逩灬. 提交于 2019-12-20 10:11:48
问题 Could somebody please explain or show some sample code of how I can use get a thumbnail to be put into a UIImageView after the user selects a photo with UIImagePickerController? Let's say I want to set a thumbnail as the image of a table view cell. When the user presses the cell, the image picker is shown and the user selects an image that is already on their device. I also want to save the path to that thumbnail so that the next time the view is displayed, the proper thumbnail can be shown.

ALAsset , send a photo to a web service including its exif data

为君一笑 提交于 2019-12-19 03:35:31
问题 I want to send a photo from the camera roll to a web services - including its exif data. Im using ASIFormDataRequest - so I do : ASIFormDataRequest *request = [[ASIFormDataRequest alloc]initWithURL:url]; To save memory I directly want to send the file: [request addFile:localPath forKey:@"image"]; So i need the local path of the asset. I think I can not get the local path of an asset, so I temporarily save the asset to a file: ALAsset* selectedAsset = [assets objectAtIndex:index]; CGImageRef

ALAssetsLibrary delete ALAssetsGroup / ALAsset

安稳与你 提交于 2019-12-17 19:48:14
问题 I have created "photos album" from my App, using IOS AssetsLibrary. Reading ALAssetsLibrary,ALAssetsGroup and ALAsset documentations, i have seen methods to "addAsset","addAssetsGroupAlbumWithName". Is there a way to delete PROGRAMMATICALLY my ALAssetsGroup and ALAsset. (the property 'editable' suppose to be TRUE because i create this data). 回答1: This is not possible using any documented API. Only the photos app can delete Albums. If you want this feature to be added to iOS, I would fill a

How to check if an ALAsset still exists using a URL

眉间皱痕 提交于 2019-12-17 15:51:46
问题 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 回答1: Use assetForURL:resultBlock:failureBlock: method of ALAssetsLibrary instead to get the asset from its URL. // Create assets library ALAssetsLibrary

imageWithCGImage leaks according to instrument

为君一笑 提交于 2019-12-12 02:45:52
问题 Below is a screenshot from instrument app. Is there any explanation what is wrong with that line ? 回答1: ARC does not manage C-types, of which CGImage may be considered. You must release the ref manually when you are finished with CGImageRelease(image); found the answer hire 来源: https://stackoverflow.com/questions/23656934/imagewithcgimage-leaks-according-to-instrument

ALAsset thumbnail at specific timestamp

只愿长相守 提交于 2019-12-12 00:23:34
问题 I'm working working on an iPhone application for uploading video files to a specific platform, and one feature I would really love is to be able to present, say, ten different thumbnails for the same video for the user to pick from. The problem is, that ALAsset only provides a thumbnail method, which just returns the default thumbnail. I have read through the ALAssetRepresentation and ALAsset documentation and I can't seem to find a way to get a thumbnail for a specific timestamp. I guess one