*** ERROR: FigCreateCGImageFromJPEG returned -12905. Input (null) was 499992 bytes.
I get a error in ios4.1 whenever i use the UIImagePicker [ just after taking a snap]. My code is a simple
UIImagePickerController *c = [[UIImagePickerController alloc] init];
c.delegate = self;
c.sourceType = UIImagePickerControllerSourceTypeCamera;
[self presentModalViewController:c animated:NO];
[c release];
Though the app. works fine, unusally it crashed one tim开发者_高级运维e in 100 trials!
May be it will be Help
// 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];
}
}
精彩评论