Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error that occurs in ios4.1 (*** ERROR: FigCreateCGImageFromJPEG returned -12905. Input (null) was 499992 bytes.)!

*** 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!

like image 797
Dhilip Avatar asked Oct 26 '10 07:10

Dhilip


1 Answers

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];
    }
}
like image 61
Nag_iphone Avatar answered Sep 30 '22 18:09

Nag_iphone