uiimagepickercontroller

UIImagePickerController doesn't fill screen

旧城冷巷雨未停 提交于 2019-11-26 05:17:32
问题 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 *)imagePicker { if (_imagePicker) { return _imagePicker; } _imagePicker = [[UIImagePickerController alloc] init]; _imagePicker.delegate = self; if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) { _imagePicker.sourceType =

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

a 夏天 提交于 2019-11-26 04:46:26
问题 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) getPhoto:(id) sender { UIImagePickerController * picker = [[UIImagePickerController alloc] init]; picker.delegate = self; if((UIButton *) sender == choosePhotoBtn) { picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; } else { picker.sourceType = UIImagePickerControllerSourceTypeCamera;

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

谁都会走 提交于 2019-11-26 04:38:54
问题 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 rendered results in an empty snapshot. Ensure your view has been rendered at least once before snapshotting or snapshot after screen updates. Here is what I am doing. imagePicker = [[UIImagePickerController alloc] init]; [imagePicker setDelegate:self]; [imagePicker setSourceType

didFinishPickingMediaWithInfo return nil photo

巧了我就是萌 提交于 2019-11-26 03:56:52
问题 I am working to capture an image that is returned in 4.0 using - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [[picker parentViewController] dismissModalViewControllerAnimated:YES]; // MediaType can be kUTTypeImage or kUTTypeMovie. If it\'s a movie then you // can get the URL to the actual file itself. This example only looks for images. // NSString* mediaType = [info objectForKey:UIImagePickerControllerMediaType]; //

Can I load a UIImage from a URL?

心已入冬 提交于 2019-11-26 02:28:39
问题 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 again? I see that UIImage has a imageWithContentsOfFile: but I have a URL. Can I use NSData\'s dataWithContentsOfURL: to read the URL? EDIT1 based on @Daniel\'s answer I tried the following code but it doesn\'t work... NSLog(@\"%s %@\", __PRETTY_FUNCTION__, photoURL); if (photoURL) { NSURL* aURL =

Swift PNG Image being saved with incorrect orientation

狂风中的少年 提交于 2019-11-26 02:14:39
问题 If I use the image before it is saved it is normal. But if I save it and use it later is is 90 degrees turned. How can I make sure it doesn\'t save sideways? func saveEvent(_ center1: CLLocation, title2: String, imagePicked1: UIImage) { let data = UIImagePNGRepresentation(imagePicked1);/// let url = NSURL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent(NSUUID().uuidString+\".dat\") do { try data!.write(to: url!, options: []) } catch let e as NSError { print(\"Error! \\(e)\");

UIImagePickerController and extracting EXIF data from existing photos

此生再无相见时 提交于 2019-11-26 01:35:56
问题 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 original files and the EXIF data stored within them, enabling the app to extract the geodata from the selected photo. They seem to do this by reading the original file from the /private/var/mobile/Media/DCIM/100APPLE/ folder and running it through an EXIF library. However, I can\'t work out a

Cropping an UIImage

吃可爱长大的小学妹 提交于 2019-11-25 22:30:10
问题 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 seen in the album view of the Photos app. (I know I could use a UIImageView and adjust the crop mode to achieve the same results, but these images are sometimes displayed in UIWebViews ). I\'ve started to notice some crashes in this code and I\'m a bit stumped. I\'ve got two different theories

iOS UIImagePickerController result image orientation after upload

岁酱吖の 提交于 2019-11-25 21:57:42
问题 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] init]; [imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera]; [imagePicker setDelegate:self]; [self.navigationController presentModalViewController:imagePicker animated:YES]; [imagePicker release]; - (void)imagePickerController:(UIImagePickerController *)picker