我试图在我的应用程序中运行基本的图像选择器/照片拍摄器,但遇到了以下错误:
*** ERROR: FigCreateCGImageFromJPEG returned -1. Input (null) was 551120 bytes
我显示了图像选择器,相机视图工作正常。
当我用相机拍摄图像并选择“使用”按钮时,控制台中会出现错误并且应用程序崩溃。
该应用程序仅适用于从相册中选择图像。我看过类似的话题 https://stackoverflow.com/questions/3139516/iphone-ios-4-0-camera-figcreatecgimagefromjpeg-returned-1这里似乎没有提出解决方案。
只是想知道是否有人遇到过任何有帮助的事情。
-(IBAction)getPhoto:(id)sender{
if((UIButton *) sender == sharePhoto) {
imagePicker.sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
} else {
imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
}
[self presentModalViewController:imagePicker animated:YES];
}
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[picker dismissModalViewControllerAnimated:YES];
imageView.image = [info objectForKey:@""];
}
我已设法阻止应用程序崩溃,但错误仍然存在。
而不是分配UIImage
来自NSDictionary *info
直接到我的UIImageView
我将它保留在UIImage
变量然后忽略ModalViewcontroller
.
In the viewWillAppear
求根的方法UIViewController
然后我将图像分配给我的UIImageView
.image.
我不知道我做事的顺序是否是根本原因。但是该错误仍然出现在控制台中。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)