When using the iPhone 4, I'm having memory issues when using the rear-facing camera. It's causing memory errors and won't assign the picture to a UIView. Here's the code.
-(IBAction)getCameraPicture:(id)sender {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = NO;
if(sender == takePictureButton)
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
else
picker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
[self presentModalViewController:picker animated:YES];
[picker release];
}
`- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
imageView.image = [info objectForKey:UIImagePickerControllerOriginalImage];
[picker dismissModalViewControllerAnimated:YES];
}`
It works fine when using the front-facing (lower quality) camera, as does loading existing pictures not taken at full quality. Is there any way to reduce the quality of the photo taken with the rear camera, or some other way to get around this issue?