uiimagepickercontroller

Capturing photos with specific resolution using the UIImagePickerController

时光毁灭记忆、已成空白 提交于 2019-12-03 07:34:16
问题 I would like to take photos of A4 pieces of paper with writing on. Importantly, I want the text to be readable, but I do not want images with resolutions like 2592x1936 pixel or 3264x2448 pixel as that would be too big. Also, I assume that rescaling the photo after capturing takes extra time, so I would like to avoid this too. We can choose between the following qualities: UIImagePickerControllerQualityTypeHigh = 0 UIImagePickerControllerQualityTypeMedium = 1 default value

Dismissing of UIImagePickerController dismisses presenting view controller also

眉间皱痕 提交于 2019-12-03 07:22:34
I am working on a project that uses tabbar system. One of the item of tabbar is JobPostingViewController. I Embed it in UINavigationController. There is a UIButton called add new job in this view controller .I implemented pushviewcontroller to go CreateJobPostViewController. There I need to add UIImagePickerController to choose the image. When i tap done button or choose an image from library it dismisses to JobPostingViewController. But it should go to the CreateJobPostViewController. Any one please help me. Thanks in advance. You can see the issue here: Code in JobPostingViewController

iPad 2 UIImagePickerController camera auto-rotation driving me mad!

你离开我真会死。 提交于 2019-12-03 06:55:12
I've been trying to sort this one out for a while and getting nowhere. I'm using the camera on the iPad 2 - my application is in landscape, but I want to use the camera in portrait mode. I just can't seem to force the ImagePicker a, into Portrait mode, and b, to stop auto-rotating. Is there any way that you can force the ImagePicker into portrait (or landscape), and/or to stop it auto-rotating? Even though the App is in landscape and is set to return YES only to landscape orientations, the ImagePicker ignores that and rotates into portrait when you rotate the iPad 2. If I could force it into

UIImagePickerController Showing Black Preview Screen

廉价感情. 提交于 2019-12-03 06:20:51
I am having a problem when calling the UIImagePickerController to use the camera. Sometimes, but more often than none, the preview screen shows to be black (as the camera itself is covered). After doing some research, it seems that people where not delegating it correctly..however, I believe my set up is correct. A restart of the app is what fixes it. In my .h file I have included UIImagePickerControllerDelegate and UINavigationControllerDelegate. Here is the code for the .m file - (IBAction)camera:(id)sender { UIImagePickerController *imagePickerController = [[UIImagePickerController alloc]

UIImagePickerController crashing on force touch?

≡放荡痞女 提交于 2019-12-03 06:10:57
问题 With iOS 9, all of my UIImagePickerControllers are now crashing if I do a force touch on the presented images. Error message is : *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSObject previewingContext:viewControllerForLocation:]: unrecognized selector sent to class 0x1a0752020' I guess this is an Apple bug, but has anybody a work around ? 回答1: Here's a workaround: https://gist.github.com/nolanw/bd0a8997632fe92a9f83 (warning: swizzles a method on a

How to retrieve PHAsset from UIImagePickerController

牧云@^-^@ 提交于 2019-12-03 05:57:27
I'm trying to retrieve a PHAsset however PHAsset.fetchAssets(withALAssetURLs:options:) is deprecated from iOS 8 so how can I properly retrieve a PHAsset? I had the same the issue, first check permissions and request access: let status = PHPhotoLibrary.authorizationStatus() if status == .notDetermined { PHPhotoLibrary.requestAuthorization({status in }) } Just hook that up to whatever triggers your UIImagePickerController. The delegate call should now include the PHAsset in the userInfo. guard let asset = info[UIImagePickerControllerPHAsset] as? PHAsset Here is my solution: func

UIImagePickerController record video with landscape orientation

怎甘沉沦 提交于 2019-12-03 05:45:13
How can we force UIImagePickerController controller to record video only in landscape mode? I know that this class should be used for portrait recording, but I need to have it in landscape. Have found several similar questions but there is not any solution which works for me (iOS 6.1). For example observation of device orientation doesn't work for me (this answer- https://stackoverflow.com/a/2147584/775779 ) If I implement UIImagePickerController category like the following: #import "UIImagePickerController+NonRotating.h" @implementation UIImagePickerController (NonRotating) - (BOOL

Edit image after taking a picture

≡放荡痞女 提交于 2019-12-03 05:20:26
问题 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 =

Grabbing the first frame of a video from UIImagePickerController?

二次信任 提交于 2019-12-03 05:11:29
问题 I'm trying to get the first frame from the selected video in a UIImagePickerController to show in a UIImageView , but I do not know if it's possible. If it is, how would I do it? 回答1: You can do this in one of two ways. The first way is to use the MPMoviePlayerController to grab the thumbnail: MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:videoURL]; moviePlayer.shouldAutoplay = NO; UIImage *thumbnail = [moviePlayer thumbnailImageAtTime:time

UIImagePickerController on iPad with IOS9

穿精又带淫゛_ 提交于 2019-12-03 04:45:48
问题 Since iOS 9 and Xcode 7 I am no longer able to implemet a UIImagePickerController on an iPad (both device and simulator). The code below works on the iPad but only prior to iOS 9. When using iOS 9+ the presented image (after the UIImagePickerController is dismissed) is an incorrect version of the selected image. Without re-sizing or cropping the final image is only the top right corner of the original image ?? Plus another problem - If imagePicker.allowsEditing = false, you are unable to