开发者

imagePickerController won't return camera photo. Will return album photo

开发者 https://www.devze.com 2022-12-26 17:11 出处:网络
i\'m loading photos from my library just fine, but photos coming from he camera don\'t display in the imageView. I\'ve set allowsImageEditing = YES. I\'ve also used CFShow(info) and the data from the

i'm loading photos from my library just fine, but photos coming from he camera don't display in the imageView. I've set allowsImageEditing = YES. I've also used CFShow(info) and the data from the camera is not nil...

 - (voi开发者_如何学God)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{   
    UIImage *image = [info objectForKey:@"UIImagePickerControllerEditedImage"];

    [self.imageView setImage:image];
    [self dismissModalViewControllerAnimated:YES];
    [picker release];   
}


Did you turn on the allowsEditing property of the UIImagePicker? If not, it's not going to return you an editedImage. You'll probably want:

UIImagePickerControllerOriginalImage


I know this is many months later, but I struggled with the same problem and found that though it was asked here many times, it was never answered. Well, I'm happy to say that I figured it out and so am posting it on a few of the nearly-identical questions that come up first on a search.

I posted the full answer here:
didFinishPickingMediaWithInfo return nil photo

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号