CGImageCreateWithImageProvider:无效的图像大小:180 x 180

时间:2013-06-28 12:43:08

标签: ios uiimage

我在设备上运行我的应用程序时出现以下错误(我没有让它在模拟器中运行):

  

CGImageCreateWithImageProvider`:图像尺寸无效:180 x 180。

- (IBAction)choosePic:(id)sender {
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
        self.imageOne = [[UIImagePickerController alloc] init];
        self.imageOne.sourceType = UIImagePickerControllerSourceTypeCamera;
        self.imageOne.delegate = self;
    }
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        self.imageOne = [[UIImagePickerController alloc] init];
        self.imageOne.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        self.imageOne.delegate = self;
    }
    [self presentViewController:self.imageOne animated:YES completion:nil];
}

1 个答案:

答案 0 :(得分:0)

根据answer

此错误可能是iOS版本较低的设备。由于某些iOS版本不支持调整图像大小。也可能是JPG图像的问题。试试PNG图片。