uiimagepickercontroller

UIImagePickerController crashes in iPad

不打扰是莪最后的温柔 提交于 2019-12-08 15:40:54
问题 -(IBAction)selectPressed:(id)sender { UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; [picker release]; } I am testing this code on iPad and iPhone simulators. In the iPhone simulator (and on real iPhones too) it's ok - gallery appears. But on the iPad simulator (I don't have a device), it crashes. Any ideas why? 回答1:

UIImagePicker freezes

∥☆過路亽.° 提交于 2019-12-08 14:28:18
I'm able to call the modal view controller for the image picker, pick the image, and crop it, but when I tap 'done' it doesn't do anything, it just hangs with the done button grayed out. There are no errors, but the function is called. - (void)viewDidLoad { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsImageEditing = YES; self.imgPicker.delegate = self; self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (void)imagePickerController:

iPhone: How to Write an Image to Disk in the App Directories

喜你入骨 提交于 2019-12-08 13:18:44
问题 I am working on an iPhone project in which I need save camera images to disk and file but the code below fails: (************ -(void)imagePickerController:(UIImagePickerController *) picker didFinishPickingMediaWithInfo:(NSDictionary *)info { [picker dismissModalViewControllerAnimated:YES]; imageView.image = [info objectForKey:@"UIImagePickerControllerOriginalImage"]; imgglobal =imageView.image; NSString *newFilePath = [NSHomeDirectory() stringByAppendingPathComponent: @"~/Users/abc/Library

While using iphone PhotoLibrary, Restrict user to select any video file more than duration of 60secs?

两盒软妹~` 提交于 2019-12-08 13:02:37
问题 Is there any method available to check video file duration as soon as user select Video from iPhone photo library ? And restrict user to select if that video file is more than 60secs 回答1: imagePickerController.videoMaximumDuration = 60.0f; // limits video length to 60 seconds. where imagePickerController is object of UIImagePickerController. Using videoMaximumDuration method you can restrict length of video from both ways. Like if you are recording video an alert will popup saying you cannot

Image-picker display multiple images like collage without memory issue

耗尽温柔 提交于 2019-12-08 12:13:48
问题 I am using this ImagePicker to select multiple images from library or camera. Once user is done selecting images, I am storing those images in to an array. I want display images to the Frame according to number of images selected. for example, if more than 5 images selected the result will be something like this from the selected Images. Imagepicker is new for me. I don't know how to achieve this. I've read many posts but not getting clear idea how to implement in my case. I am testing it on

UIImagePickerController - how to save image to core data?

淺唱寂寞╮ 提交于 2019-12-08 11:08:28
问题 I have an app, which uses the UIImagePicker to let the use take a photo or choose a photo from the gallery. The picking and displaying works so far, but I need some guidance what to do and how next. Here's my delegate method: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { UIImage *chosenImage = info[UIImagePickerControllerEditedImage]; self.userImageView.image = chosenImage; [picker dismissViewControllerAnimated:YES

iOS 4 Image Oriented Incorrectly When Posted To Server

北慕城南 提交于 2019-12-08 09:58:44
问题 I am a relatively new iOS developer. I am attempting to build an app that uploads images to a server. However, when I get the image with metadata, the orientation is always off. Here is the code I am using: - (void)getJPEGFromAssetForURL:(NSURL *)url { ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init]; [assetslibrary assetForURL:url resultBlock: ^(ALAsset *myasset) { self.rep = [myasset defaultRepresentation]; NSLog(@"getJPEGFromAssetForURL: default asset representation for %@:

Showing a HUD whilst an image is downscaled in size

让人想犯罪 __ 提交于 2019-12-08 09:26:34
问题 I have an app where the user takes a photo using the Camera and then chooses to Use the photo. The following method is called: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info Within this method I check the NSData length of the image and resize the actual image if the data (Kb) size is too large, then check again. This way I only scale down small amounts to keep the highest quality/sized image rather than a specific size w/h.

How to edit metadata of image in iOS8?

坚强是说给别人听的谎言 提交于 2019-12-08 08:56:20
问题 ALAssetsLibrary *lib = [[ALAssetsLibrary alloc] init]; [lib assetForURL:nil resultBlock:^(ALAsset *asset) { NSDictionary *metadata = rep.metadata; if (metadata) { NSDictionary *GPSDict=metadata[@"{GPS}"]; NSDictionary *TIFFDict=metadata[@"{TIFF}"]; if (GPSDict){ double longitude = [[GPSDict objectForKey:@"Longitude"] doubleValue]; double latitude = [[GPSDict objectForKey:@"Latitude"] doubleValue]; if ([[GPSDict objectForKey:@"LatitudeRef"] isEqualToString:@"S"]) { latitude = -latitude; } if (

UIImagePicker freezes

末鹿安然 提交于 2019-12-08 07:41:04
问题 I'm able to call the modal view controller for the image picker, pick the image, and crop it, but when I tap 'done' it doesn't do anything, it just hangs with the done button grayed out. There are no errors, but the function is called. - (void)viewDidLoad { self.imgPicker = [[UIImagePickerController alloc] init]; self.imgPicker.allowsImageEditing = YES; self.imgPicker.delegate = self; self.imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [super viewDidLoad]; // Do any