phphotolibrary

How To get Image URL From PHAsset? Is it possible To save Image using PHAsset URL to document Directory?

荒凉一梦 提交于 2019-12-01 07:28:58
问题 I used `NSURL *urlA = [info valueForKey:@"PHImageFileURLKey"];` but when i try to save image using URL then URL is nil. `NSData *pngData =[NSData dataWithContentsOfURL:urlA options:NSDataReadingMapped error:nil];` 回答1: asset = Here you have to pass your PHAsset . PHImageRequestOptions * imageRequestOptions = [[PHImageRequestOptions alloc] init]; [[PHImageManager defaultManager] requestImageDataForAsset:asset options:imageRequestOptions resultHandler:^(NSData *imageData, NSString *dataUTI,

Disable confirmation on delete request in PHPhotoLibrary

爷,独闯天下 提交于 2019-11-30 19:29:52
What I am trying to do is to save videos to PHPhotoLibrary, and then remove them when upload to clients remote server in the application completes (basically, photo library serves as temporary storage to add additional layer of security in case anything at all fails (I already save my vides it in the applications directory). Problem: The problem is for that to work, everything has to work without input from the user. You can write video to photos library like this: func storeVideoToLibraryForUpload(upload : SMUpload) { if PHPhotoLibrary.authorizationStatus() != PHAuthorizationStatus.Authorized

How to get the URL of an image just added in PHPhotoLibrary

拜拜、爱过 提交于 2019-11-30 06:42:59
I am using the UIImagePickerController in two cases to select an existing image in the Photo Library to take a new picture In the first case, when I choose an image form the library, I can easily get the URL in the delegate method: - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // Get the URL NSURL *url = [info valueForKey:UIImagePickerControllerReferenceURL]; ... } But when I take a new picture, the image is not yet in the photo library and has no URL yet. So, I first need to add the image in the Library. But then, how to

How to get the URL of an image just added in PHPhotoLibrary

為{幸葍}努か 提交于 2019-11-29 07:38:58
问题 I am using the UIImagePickerController in two cases to select an existing image in the Photo Library to take a new picture In the first case, when I choose an image form the library, I can easily get the URL in the delegate method: - (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { // Get the URL NSURL *url = [info valueForKey:UIImagePickerControllerReferenceURL]; ... } But when I take a new picture, the image is not yet in

Determine if the access to photo library is set or not - PHPhotoLibrary

寵の児 提交于 2019-11-26 19:31:56
With the new functionality in iOS 8, if you are using a camera in the app, it will ask for permission to access the camera and then when you try to retake the pic, it asks for permission to access photo library. Next time when I launch the app, I wish to check if the camera and photo library has access permissions to it. For camera, I check it by if ([AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo] == AVAuthorizationStatusDenied) { // do something } I am looking for something similar to this for photo library. Check +[PHPhotoLibrary authorizationStatus] – if not set, it will