alassetslibrary

Unable to get File name of image captured with camera

耗尽温柔 提交于 2020-01-13 15:02:18
问题 I'm trying to build an app in which I'm able to capture image with camera and save to gallery. But I'm unable to get the file name of image. If I select image from camera roll, then I'm able to get file name of selected image.But when I capture image with camera in my app, It returns file name " null ". Here is my code to save and select image from gallery using UIImagePickerController - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary

Read images from a iphone album using ALAssetsLibrary

对着背影说爱祢 提交于 2020-01-13 10:58:39
问题 I am trying to write a method that read assets from a album I am getting all images from all album using ALAsset, my question is how can I customize this method to read images from myAlbum /** * This method is used to get all images from myAlbum * folder in device if getAlbumImages is set to 1 * else loads all images from devices library */ -(void)readImages:(int)getAlbumImages { imageArray = [[NSArray alloc] init]; mutableArray =[[NSMutableArray alloc]init]; NSMutableArray*

ALAssetsLibrary is Nil, Can't Save Video To Photo Album

[亡魂溺海] 提交于 2020-01-06 16:16:27
问题 I am having trouble using ALAssetsLibrary to write a video from a URL into my saved photos album. I am not sure how to go about initializing the library correctly. Apple's reference to ALAssetsLibrary doesn't really explain how to do so. I am getting the usual unwrapping nil value error. Could anybody point me in the right direction here? I'll gladly take any tips as well as to how I can make things more efficient, or guides and tutorials that could teach me how. here is my code that tells

Check if an image is already in gallery and retrieve it

﹥>﹥吖頭↗ 提交于 2020-01-06 03:57:06
问题 I need to know if an image is already in the iOS gallery. I am developing a messaging client app and, in my chat list, I am able to download images/videos of incoming messages when I tap into the image thumbnail. The issue is, when I tap in the thumbnail, I download and save that image into the iOS photo gallery, but if I tap again I don't want to download and save it again, I want to retrieve it from the photo gallery. Resuming, I want to look for the image in the photo gallery and retrieve

How to get exif information from ALAsset?

血红的双手。 提交于 2020-01-05 23:17:14
问题 I need to get exif information from selected asset and to display part of it on the screen. 回答1: [[asset defaultRepresentation] metadata]; returns a dictionary of dictionaries of metadata for the given asset representation. Check out this dictionary for the data you're interested in. I am not sure but I think the keys in that dictionary (and subdictionaries) are the same as the ones listed under CGImageProperties Reference. 回答2: This is a complete answer ... all in one spot NSDictionary *nsd

Error occuring when loading photolibrary images : ERROR: FigCreateCGImageFromJPEG returned -12910. 423114 bytes. We will fall back to software decode

╄→гoц情女王★ 提交于 2020-01-04 05:53:11
问题 I'm working with an application in which I'm loading images from photolibrary. I'm using the following code for binding the image to imageView. -(void)loadImage:(UIImageView *)imgView FileName:(NSString *)fileName { typedef void (^ALAssetsLibraryAssetForURLResultBlock)(ALAsset *asset); typedef void (^ALAssetsLibraryAccessFailureBlock)(NSError *error); ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentation *rep = [myasset defaultRepresentation];

ALAssetsLibrary image twisted

丶灬走出姿态 提交于 2020-01-03 05:32:50
问题 I'm using the following code to load images form the camera roll. But when the images are shown in an uiimageview, the images are sometimes rotated by 90 degrees to the left. How can I correct this? Thanks! ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentation *rep = [myasset defaultRepresentation]; CGImageRef iref = [rep fullResolutionImage]; if (iref) { cell.image.image = [UIImage imageWithCGImage:iref]; } }; ALAssetsLibraryAccessFailureBlock

Creation Date from Camera Roll Image

一世执手 提交于 2020-01-02 23:07:11
问题 I'm struggling with getting the creation date from an image selected in the camera roll. Here is my code: func imagePickerController(picker: UIImagePickerController!, didFinishPickingMediaWithInfo info:NSDictionary!) { var tmpImg = info[UIImagePickerControllerOriginalImage] as UIImage var metaData: NSDictionary var exifData: NSDictionary let library = ALAssetsLibrary() var dataJpeg: NSData var url: NSURL = info.objectForKey(UIImagePickerControllerReferenceURL) as NSURL library.assetForURL(url

The best way to get thumbnails with ALAssetsLibrary

送分小仙女□ 提交于 2020-01-02 07:19:14
问题 I am handling with the ALAssetsLibrary. When I get all the thumbnails, I just use the UIImageViews to hold the thumbnails and add them to the holder. Problem is here, it is really slow to add them. Maybe ten seconds or more. If there is much photos, it will be slower. I would want to know what is the best practice to hold these thumbnails. (Many thanks!) 回答1: Use AlAsset aspectRatioThumbnail instead of fullResolutionImage for high performance The class ALAsset has two methods to get

How to enumerate all photos on iOS 8 using ALAssetsLibrary

廉价感情. 提交于 2020-01-02 03:13:10
问题 iOS 8 broke lots of apps by removing "Camera Roll" from the ALAssetsLibrary enumerating API. I know I can get all photos using the new Photos framework. But my app has a lot of code depending on ALAsset related classes and I need to keep iOS 7 support. Is there a way to enumerate all photos using ALAssetsLibary on iOS 8, without enumerating asset group first? 回答1: Apple just released 8.0.1 and listed this as a included fix. Might just be best to wait for that. From the 8.0.1 release notes: