Questions tagged [uiimagepickercontroller]

Questions related to the iOS UIImagePickerController class (and the associated UIImagePickerControllerDelegate protocol), which provides system-supplied user interfaces for taking pictures and movies on iOS devices, and for choosing saved images and movies.

uiimagepickercontroller
Filter by
Sorted by
Tagged with
349 votes
20 answers
146k views

iOS UIImagePickerController result image orientation after upload

I am testing my iPhone application on an iOS 3.1.3 iPhone. I am selecting/capturing an image using a UIImagePickerController: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] ...
james's user avatar
  • 26.2k
314 votes
35 answers
189k views

Adding images or videos to iPhone Simulator

I am trying to use UIImagePickerController with UIImagePickerControllerSourceTypePhotoLibrary, but it says, "No photos". Where does the simulator get the images from? Where should I copy the images so ...
Vijayeta's user avatar
  • 5,615
230 votes
20 answers
115k views

iOS 8 Snapshotting a view that has not been rendered results in an empty snapshot

In iOS 8 I am having problem capturing images from camera till now I am using this code for UIImagePickerController *controller=[[UIImagePickerController alloc] init]; controller.videoQuality=...
souvickcse's user avatar
  • 7,782
220 votes
26 answers
187k views

Cropping an UIImage

I've got some code that resizes an image so I can get a scaled chunk of the center of the image - I use this to take a UIImage and return a small, square representation of an image, similar to what's ...
Jablair's user avatar
  • 5,036
160 votes
6 answers
98k views

Detect permission of camera in iOS

I am developing a very simple video app. I use the official control: UIImagePickerController. Here is the problem. When presenting the UIImagePickerController for the first time, the iOS will ask for ...
user418751's user avatar
  • 1,945
141 votes
12 answers
177k views

Can I load a UIImage from a URL?

I have a URL for an image (got it from UIImagePickerController) but I no longer have the image in memory (the URL was saved from a previous run of the app). Can I reload the UIImage from the URL ...
progrmr's user avatar
  • 76.6k
111 votes
20 answers
185k views

How to allow user to pick the image with Swift?

I am writing my first iOS application (iPhone only) with Swift. The main application view should allow user to choose the image from the photo gallery. I've found the following sample code of ...
LA_'s user avatar
  • 20.1k
103 votes
16 answers
68k views

UIImagePickerController error: Snapshotting a view that has not been rendered results in an empty snapshot in iOS 7

I am getting this error only in iOS 7 and the application crashed. In iOS 6, I never get any error, just once of memory warning when opening the camera. Snapshotting a view that has not been ...
Didats Triadi's user avatar
102 votes
5 answers
60k views

iOS 10 error [access] <private> when using UIImagePickerController

I am using XCode 8 and testing with iOS 10.2 Beta. I have added the Photos, PhotosUI and MobileCoreServices frameworks to project. Very simple code: #import <Photos/Photos.h> #import <...
sudoExclamationExclamation's user avatar
101 votes
5 answers
73k views

presentModalViewController:Animated is deprecated in ios6

I am using the following code for an image picker. But when I run it in the simulator, I have a memory leak and I get a warning about presentModalViewcontroller:animated being deprecated in iOS6. I ...
Ram's user avatar
  • 1,697
67 votes
10 answers
35k views

Front facing camera in UIImagePickerController

I am developing the front facing camera app in iPad2 by using the UIImagePickerController. When I capture the image it's shows as flipped from left to right. How do I correct this? if ([...
dineshprasanna's user avatar
66 votes
8 answers
37k views

Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey'

I'm using Apple's Swift iOS Tutorial. Which is throwing an error, Cannot subscript a value of type '[String : Any]' with an index of type 'UIImagePickerController.InfoKey' The function they ...
drobati's user avatar
  • 761
63 votes
15 answers
33k views

UIImagePickerController doesn't fill screen

I'm adding a custom overlay to the UIImagePickerController and there is a persistant black bar at the bottom of the view. Here is my code to instantiate the controller. - (UIImagePickerController *)...
kubi's user avatar
  • 48.8k
56 votes
12 answers
31k views

UIImagePickerController not presenting in iOS 8

Is anyone else having an issue with UIImagePickerController in iOS 8? The method below works perfectly well in iOS 7 on an iPad, but I get the following error when I run this in XCode 6 (Beta 3 or 4) ...
Dave's user avatar
  • 2,409
56 votes
18 answers
49k views

UIImagePickerController and extracting EXIF data from existing photos

It's well known that UIImagePickerController doesn't return the metadata of the photo after selection. However, a couple of apps in the app store (Mobile Fotos, PixelPipe) seem to be able to read the ...
tomtaylor's user avatar
  • 2,309
52 votes
9 answers
89k views

How to make UIImagePickerController for camera and photo library at the same time in swift

I use UIImagePickerController to take a photo by camera of iPhone. I want to show both "take a photo" and "choose a photo". My code imagePicker = UIImagePickerController() imagePicker.delegate = ...
Coucou's user avatar
  • 645
52 votes
14 answers
95k views

How to get image file size in Swift?

I am using UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIPopoverControllerDelegate these delegates for choosing image from my gallery or my camera. So, how can I get image file ...
Orkhan Alizade's user avatar
50 votes
6 answers
106k views

Swift - UIImagePickerController - how to use it?

I am trying hard to understand how this works, but it's pretty hard for me. =) I have 1 view, there is one button and one small ImageView area for preview. The button triggers imagepickercontroller, ...
user3806731's user avatar
48 votes
9 answers
29k views

How to open the ImagePicker in SwiftUI?

I need to open an image picker in my app using SwiftUI, how can I do that? I thought about using the UIImagePickerController, but I don't know how to do that in SwiftUI.
Shahar Melamed's user avatar
47 votes
8 answers
12k views

UIImagePicker allowsEditing stuck in center

I have a UIImagePicker that works perfect for a type of UIImagePickerControllerSourceTypePhotoLibrary, but when I use UIImagePickerControllerSourceTypeCamera, the editing box cannot move from the ...
Eric's user avatar
  • 5,671
43 votes
3 answers
29k views

iPhone: Camera Preview Overlay

How do I add an overlay (UIImageView) to the camera preview and handle touches on this? My previous attempts to do this (e.g. use UIImagePickerController and add the image as a subview) have failed.
Stefan's user avatar
  • 28.9k
41 votes
2 answers
56k views

Saving Picked Image to CoreData

I am able to pick and display an image from the photo library, but my goal is to be able to save that picked image or file path to core data so that when that saved record is chosen that image will ...
turtle02's user avatar
  • 613
41 votes
3 answers
10k views

What's the difference between Camera Roll and Photo Library?

UIImagePickerController has these source type constants: UIImagePickerControllerSourceTypePhotoLibrary UIImagePickerControllerSourceTypeSavedPhotosAlbum The documentation says one is for the photo ...
openfrog's user avatar
  • 40.4k
40 votes
4 answers
100k views

Camera with Custom View

My Application uses camera, I would like to add overlay over the camera preview. For example, I want to use a picture frame when I use Camera, also I would like to add a custom bar for camera ...
cyclingIsBetter's user avatar
39 votes
2 answers
16k views

Setting delegate for UIImagePicker returns error

Having a problem in some swift code I had written for an OCR translation app. The code snippet is below: @IBAction func btnOCR(sender: AnyObject) { var languageAlert = UIAlertController(title: "...
Jacob King's user avatar
  • 6,047
39 votes
4 answers
50k views

Set dimensions for UIImagePickerController "move and scale" cropbox

How does the "move and scale screen" determine dimensions for its cropbox? Basically I would like to set a fixed width and height for the "CropRect" and let the user move and scale his image to fit ...
Thomas K's user avatar
  • 6,176
39 votes
1 answer
9k views

When should I use UIImagePickerControllerSourceTypePhotoLibrary instead of UIImagePickerControllerSourceTypeSavedPhotosAlbum?

I have an application that allows the user to pick a photo from their device. To do this, I'm using the UIImagePickerController, but the problem is that I'm unsure whether I should be using a source ...
Micah Hainline's user avatar
38 votes
8 answers
34k views

Presenting a modal view controller immediately after dismissing another

I'm dismissing a modal view controller and then immediately presenting another one, but the latter never happens. Here's the code: [self dismissModalViewControllerAnimated:YES]; ...
James Skidmore's user avatar
38 votes
1 answer
15k views

UIImagePickerController - How do I access the front facing camera by default?

I am bringing up the camera with the following code from my ViewController: - (void)viewDidLoad { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.sourceType = ...
Albert Renshaw's user avatar
38 votes
12 answers
24k views

UIImagePickerController camera view rotating strangely on iOS 8 (pictures)

I have a very simple application: - All orientations are permitted with only a button on a screen - The button show a UIImagePickerController (to take a photo) - Build with Xcode 5 and SDK 7 On iOS 8,...
Kevin Hirsch's user avatar
37 votes
7 answers
48k views

how to capture camera with UIImagePickerController in swift?

I'm trying use UIImagePickerController in swift but isn't work... my ViewController: class ViewController: UIViewController { @IBOutlet var imag : UIView = nil @IBAction func capture(sender : ...
user3745888's user avatar
  • 6,193
37 votes
7 answers
12k views

iPhone, "More than maximum 5 filtered album lists trying to register. This will fail." Error

When I try to read an image from the photo library I get the error, "More than maximum 5 filtered album lists trying to register. This will fail." The image is not read. Any idea how to fix this?
SolidSnake4444's user avatar
36 votes
7 answers
29k views

iOS 8 SDK: modal UIWebView and camera/image picker

I have found that, when compiling for iOS 8 (and running in iOS 8), a UIWebView cannot show the camera/image picker if the UIWebView is in a view controller presented modally. It works without problem ...
yonosoytu's user avatar
  • 3,319
35 votes
4 answers
29k views

Resizing UIimages pulled from the Camera also ROTATES the UIimage?

I am getting UIimages from the camera and assigning them to UIImageViews to be displayed. When I do this the camera gives me a 1200 x 1600 pixel image which I then assign to a UIImageView in my ...
RexOnRoids's user avatar
32 votes
6 answers
17k views

iOS7 iPad Landscape only app, using UIImagePickerController

I believe this is a common issue and many answers don't work anymore, many just partial, if you are under iOS7 and your iPad app is Landscape only, but you want to use the UIImagePickerController with ...
Peter Lapisu's user avatar
  • 20.5k
32 votes
9 answers
33k views

Using UIImagePickerController in landscape orientation

I am creating an app which is in landscape mode and I am using UIImagePickerController to take photos using iPhone camera in it and I want to create it in landscape mode too. But as the Apple ...
Paras Gorasiya's user avatar
32 votes
5 answers
56k views

How to select any Video or Movie file from UIImagePickerController

In my app, i need to select any video file and show the display the url for a video file in the application. -(void)viewDidLoad{ [super viewDidLoad]; self.imgPicker = [[...
user1379448's user avatar
32 votes
7 answers
8k views

UIImagePickerController on iPad with IOS9

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+ ...
pete's user avatar
  • 3,020
30 votes
8 answers
39k views

didFinishPickingMediaWithInfo return nil photo

I am working to capture an image that is returned in 4.0 using - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [[picker ...
Rob Bonner's user avatar
  • 9,346
29 votes
8 answers
22k views

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

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 ...
Frederick C. Lee's user avatar
29 votes
2 answers
12k views

iPhone - UIImagePickerControllerDelegate inheritance

I have added a UIImagePickerController to a UIViewController. I have also assigned the UIImagePickerControllerDelegate to that UIViewController. When I execute the following line, myPicker.delegate ...
Duck's user avatar
  • 35.5k
29 votes
7 answers
18k views

iPhone video recording: "cameraCaptureMode 1 not available because mediaTypes does contain public.movie"

I tried to record a video. The message I got is from the following code on the device: UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init]; imagePickerController....
Danail's user avatar
  • 10.5k
29 votes
3 answers
30k views

how to change the UIImagePickerController crop frame

when opening working with an UIImagePickerController and setting allowsImageEditing = YES; there is a default cropping frame that is 320x320. In my case, I would like to setup that cropping frame to ...
user123404's user avatar
27 votes
8 answers
66k views

Getting URL of UIImage selected from UIImagePickerController

I'm trying to provide a user selection of an image from Photo Library. Thus I'm using UIImagePickerController for selecting. But here comes an issue with getting its initial URL in the file system (I ...
mozharovsky's user avatar
  • 1,255
27 votes
7 answers
10k views

How to know if iPhone camera is ready to take picture?

When [camera takePicture] is called before the camera is ready, it spits out this message: UIImagePickerController: ignoring request to take picture; camera is not yet ready. How can I know when it ...
James Skidmore's user avatar
27 votes
1 answer
17k views

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

Is there any way to define the crop area rect using the camera image picker?
dan's user avatar
  • 5,407
26 votes
5 answers
18k views

How to avoid compression after selecting video from UIImagePickerController in ios

I am using UIImagePickerController to select video from Gallery and it compress that video.I want to disable Compression but I don't find the way to do this. I also tried with ELCImagePickerController ...
DeviPhone26's user avatar
26 votes
3 answers
7k views

iOS 7 UIImagePicker preview black screen

When i try to load camera from my code, camera preview is black. If I wait for 10-20 seconds it will show real camera preview. I found several questions and some of them suggest that running some ...
user2689024's user avatar
26 votes
4 answers
10k views

iPad iOS7 - UIImagePickerController in UIPopoverController has wrong preview image

I am using an UIImagePickerController within an UIPopoverController which is working perfectly with iOS6. With iOS 7 the "preview" image which is shown to capture the image is rotated, but if I take a ...
Marcus Franzen's user avatar
25 votes
9 answers
51k views

How can i get the name of image picked through photo library in iphone?

I am picking an image from photo library in iphone application. How will i retrieve the actual image name. in .h class UIImageView * imageView; UIButton * choosePhotoBtn; in .m class -(IBAction) ...
Sandeep Singh's user avatar

1
2 3 4 5
83