*** ERROR: FigCreateCGImageFromJPEG returned -12905. Input (null) was 499992 bytes.
每当我使用UIImagePicker时,我都会在ios4.1中出现错误[刚拍完之后]。我的代码很简单
UIImagePickerController *c = [[UIImagePickerController alloc] init];
c.delegate = self;
c.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:c animated:NO];
[c release];
虽然应用程序。工作得很好,不同寻常地在100次试验中坠毁了一次!
答案 0 :(得分:1)
可能是帮助
// u also import framework "MobileCoreServices"
UIImagePickerController *c = [[UIImagePickerController alloc] init];
c.delegate = self;
c.sourceType = UIImagePickerControllerSourceTypeCamera;
NSString *requiredMediaType;
requiredMediaType = (NSString *)kUTTypeImage;
imagePicker.mediaTypes = [NSArray arrayWithObject:requiredMediaType];
[self presentModalViewController:c animated:NO];
[ c release];
}
- (void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
NSString *ItemMediaType = [info objectForKey:
UIImagePickerControllerMediaType];
if ([ItemMediaType isEqualToString:(NSString *)kUTTypeImage] == YES){
UIImage *theImage = nil;
if (picker.allowsEditing == YES){
theImage = [info objectForKey:UIImagePickerControllerEditedImage];
} else {
theImage = [info objectForKey:UIImagePickerControllerOriginalImage];
}
}