uiimagepickercontroller

UIImagePickerController run out of memory with camera source

假装没事ソ 提交于 2019-12-02 21:30:51
I got a big performance issue using UIImagePickerController and saving the image on disk. I can't figure out what I am doing wrong. Here is my code: - (void)imagePickerController:(UIImagePickerController *)pick didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; NSData *imageData = [NSData dataWithData:UIImagePNGRepresentation(image)]; iPixAppDelegate *delegate = (iPixAppDelegate *)[[UIApplication sharedApplication] delegate]; [delegate addPicture:imageData]; } The addPicture method creates a new picture object that

From the results of UIImagePickerControlleHow, how do I get JPEG with metadata included in it?

时光怂恿深爱的人放手 提交于 2019-12-02 21:23:04
On iOS 4.2 when I use UIImagePickerController to let the user select a image from the photo library these are the dictionary keys that are returned to me: 2011-03-02 13:15:59.518 xxx[15098:307] didFinishPickingMediaWithInfo: info dictionary: { UIImagePickerControllerMediaType = "public.image"; UIImagePickerControllerOriginalImage = "<UIImage: 0x3405d0>"; UIImagePickerControllerReferenceURL = "assets-library://asset/asset.JPG?id=1000000050&ext=JPG"; } Using one or more of these keys, how can I get a JPEG representation that would include the image metadata (such as exposure information and GPS

uiimagepickercontroller - get the name of the image selected from photo library

笑着哭i 提交于 2019-12-02 21:21:45
I am trying to upload the image from my iPhone/iPod touch to my online repository, I have successfully picked the image from Photo Album but i am facing one problem i want to know the name of the image such as image1.jpg or some thing like that. How i would know the name of the picked image. I guess knowing the exact image name would not be an issue rather getting a unique name for the picked image would solve your purpose so that you can upload the image on server and track it via its name. May be this can help you NSMutableString *imageName = [[[NSMutableString alloc] initWithCapacity:0]

How to record a video automatically in Iphone app without user interaction

本小妞迷上赌 提交于 2019-12-02 21:19:22
问题 I am working an iphone app that needs to record a vedio automatically. I used mobile coreservices framework and using that. I made it to came into video mode and clicking on record option its start capturing a vedio. But I want it automatically that is.. I should able to record a video without clicking on record option. That is when video mode comes up its automatically start record video. Could any one help? 回答1: You can look at UIImagePickerControllers startVideoCapture method which is used

iOS - How to customize the crop rect in UIImagePickerController with allowsEditing on?

柔情痞子 提交于 2019-12-02 21:18:46
Is there any way to define the crop area rect using the camera image picker? Yetanotherjosh Unfortunately, no. You have to implement a custom cropping GUI to get anything other than the default, as stated in the Camera Programming Topics for iOS: "When using built-in editing controls, the image picker controller enforces certain options. For still images, the picker enforces a square cropping as well as a maximum pixel dimension. For movies, the picker enforces a maximum movie length and resolution. If you want to let the user edit full-size media, or specify custom cropping, you must provide

Enabling the photo library button on the UIImagePickerController

筅森魡賤 提交于 2019-12-02 20:38:17
Does anyone know how to enable the photo album button on the UIImagePickerController when its in the camera mode? Like how the camera app on on the iphone can toggle between image and video taking and also has the button to view the photo library? I'm afraid that this can't be done in that easy way (just enable or disable some magic feature). For some simple requirement, you can use cameraOverlayView and showsCameraControls to make the implementation. If you want to switch between photo/video mode, i think you can check this demo: http://developer.apple.com/library/ios/#samplecode/AVCam

How do you color/customize the UIImagePickerController's Navigation Bar?

一个人想着一个人 提交于 2019-12-02 20:20:48
What is the correct way to color the UIImagePickerController's nav bar? I merely tried to see the background color but I'm getting a faded color as seen in the image below; as if some view is obstructing it. let picker = UIImagePickerController() picker.sourceType = type picker.mediaTypes = [kUTTypeImage] picker.delegate = self picker.navigationBar.backgroundColor = UIColor.redColor() It appears to have some view obscuring the redColor(): (lldb) po picker.navigationBar.subviews 2 values { [0] = 0x00007fe7bb52a890 [1] = 0x00007fe7bb52b670 } What is the correct way to create a solid color for

Crash when pushing to another controller after `didFinishPickingMediaWithInfo`

邮差的信 提交于 2019-12-02 20:10:14
问题 I'm trying to have the app go to a different view controller after the user chooses a photo from the picker. func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { if let image = info[UIImagePickerControllerEditedImage] as? UIImage { let previewController = self.storyboard?.instantiateViewController(withIdentifier: "previewVC") as! PreviewViewController previewController.previewImage.image = image previewController.navigationItem

AVAudioRecorder won't record IF movie was previously recorded & played

雨燕双飞 提交于 2019-12-02 19:38:07
My iPhone app uses "AVAudioRecorder" to make voice recordings. It also uses "UIImagePickerController" to record movies and "MPMoviePlayerController" to play movies. Everything works fine until I do all three things in a row: Record a movie using UIImagePickerController Play back the recorded movie using MPMoviePlayerController Try to make a voice recording using AVAudioRecorder When I call AVAudioRecorder's "record" method in step 3, it returns NO indicating failure, but giving no hints as to why (come on Apple!) AVAudioRecorder's audioRecorderEncodeErrorDidOccur delegate method is never

Edit image after taking a picture

£可爱£侵袭症+ 提交于 2019-12-02 18:38:02
I'm currently making an iphone app where the user takes a photo or select it from an album, then an overlay is placed over the image. The user can then scale, rotate and save the image. Currently, I can take pictures, or choose one for the album. As for the overlay, I just used UIImageView and placed it on top of the hierarchy in Interface builder. For the camera, I'm using this code: -(IBAction)getPhoto:(id)sender { // Create an image picker controller UIImagePickerController * imagePicker = [[UIImagePickerController alloc] init]; if((UIButton *) sender == choosePhotoBtn) { // Set source to