*** 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 time 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];
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With