uiimagepickercontroller

How to speed up saving a UIImagePickerController image from the camera to the filesystem via UIImagePNGRepresentation()?

不想你离开。 提交于 2019-12-07 09:50:06
问题 I'm making an applications that let users take a photo and show them both in thumbnail and photo viewer. I have NSManagedObject class called photo and photo has a method that takes UIImage and converts it to PNG using UIImagePNGRepresentation() and saves it to filesystem. After this operation, resize the image to thumbnail size and save it. The problem here is UIImagePNGRepresentation() and conversion of image size seems to be really slow and I don't know if this is a right way to do it. Tell

Capture camera view and onverlay in an image

倾然丶 夕夏残阳落幕 提交于 2019-12-07 07:07:01
问题 I open the camera view and place an image as an overlay. I then want to save both the overlay and the camera view's image as one image. Previously I achieved this using UIGetScreenImage(). Now that Apple forbid this what are my options ? takePicture will only capture the camera data but the the overlay. Merging the overlay with the image from takePicture is a bit slow. 回答1: You really will have to merge them, and it shouldn't take more than a second or two. Something like(untested, but should

Wrong screen size after dismissing UIImagePickerController

孤街醉人 提交于 2019-12-07 04:48:02
问题 I have an iOS app like whatsapp & ... when I present UIImagePickerController with UIImagePickerControllerSourceTypeCamera source type. imagePicker = [UIImagePickerController new]; imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera; imagePicker.delegate = self; imagePicker.mediaTypes =[NSArray arrayWithObjects:(NSString *)kUTTypeMovie,(NSString *)kUTTypeImage,nil]; [self presentViewController:imagePicker animated:YES completion:nil]; Problem Some times after cancel or finish

Using UIImagePicker in a tabbed UIPopover

本秂侑毒 提交于 2019-12-07 04:44:19
问题 I am developing an iPad app that needs to have multiple image sources, on the device/Photo Albums, remote and some included with the app. Now the ideal situation would be to have a UIPopover controller with 3 tabs for each source. The only problem is I can't seem to figure out how to have a UIImagePicker be in its own tab. What I am trying to do is very similar to Apple's Keynote for iPad. The photo icon's popover has tabs and the far left tab called media for sure has a UIImagePicker in

Upload large video via NSURLSession causes memory pressure crash

↘锁芯ラ 提交于 2019-12-07 01:42:30
问题 I use the following codes to upload video to server, which requires me to convert the video from video format to NSData . However, when the video is large (e.g. 10 minute video), the App crashes due to memory pressure. How can I resolve this? - (void)uploadVideo { NSDictionary *params = nil; NSString *NSURLSessionIdentifier = [NSString stringWithFormat:@"%@%@",@"my.bundle.identifier.",[self getTimeString]]; NSURLSessionConfiguration *sessionConfig; // SessionConfiguration With iOS Version if

UIImagePickerController with camera source with allows editing yes : video trimming doesn't work

北战南征 提交于 2019-12-07 01:12:18
问题 I am using UIImagePickerController to record a video with the sourceType set to UIImagePickerControllerSourceTypeCamera . I have set allowsEditing to true. After capturing video I edit the video using the trimming interface and press "Use", I only get back the original recording not the trimmed version. What am I doing wrong? I am using iOS 5. -(void)shootvideo { imagePicker = [[UIImagePickerController alloc] init]; [imagePicker.view addSubview:test]; [imagePicker.view addSubview:test2];

add photos to iPhone simulator

我们两清 提交于 2019-12-07 00:55:45
问题 I need than on button click opens iPhone's default album and I'll can chose a photo. I read a lot about this, but still don't works. I do the following: ~/Library/Application Support/iPhone Simulator/User/Media/DCIM/100APPLE/ I'm storing two pictures IMG_0000.JPG (300 on 300 px) and IMG_0000.THM (75 on 75px) In my app I do the following on button click: - (IBAction) btnOpenAlbum { album = [[UIImagePickerController alloc] init]; album.delegate = self; album.sourceType =

UIImagePickerController delegate not called Swift 3

谁说我不能喝 提交于 2019-12-06 20:43:33
问题 On the surface I thought that this had to be a delegate issue, but after asking for the delegate the right one was returned. I created an ImagePicker class to handle all the UIImagePickerController stuff. Every thing works until the delegate methods need to be called. After I pick a photo, the imagePicker dismisses, but the didFinishPickingMediaWithInfo method never gets called. Please help! Thanks :) func selectPhoto() { imagePicker.delegate = self //Delegate gets set here let photoAsk =

How to get image name from UIImagePickerControllerPHAsset taken with library or camera?

喜欢而已 提交于 2019-12-06 19:49:01
问题 I want to get the file name from UIImagePickerControllerPHAsset in ios 11.0.3. unable to get picked image file name using this code. please help on this? if #available(iOS 11.0, *) { let asset = info[UIImagePickerControllerPHAsset] as? PHAsset fileName = ((asset?.value(forKey: "filename")) as? String)! } else { // Fallback on earlier versions let url = info[UIImagePickerControllerReferenceURL] as! URL let assets = PHAsset.fetchAssets(withALAssetURLs: [url], options: nil) fileName =

Range slider's touch (box) of video trimmer “off”

此生再无相见时 提交于 2019-12-06 16:52:20
问题 I am using FDTake (the pod wont be too important for this question but still) to select videos from Photos which works fine. However, I would also like to be able to edit videos and limit their length to about 12 seconds. To do so I looked at the code of the pod and changed line 271 to self.imagePicker.allowsEditing = true which already causes the problem I haven't been able to solve so far: The left slider's touch (box) is “off”. Since that's a rather vague description I uploaded a video and