In my app, the user picks an image with UIImagePickerController. They can then view a gallery of the pictures they’ve selected. If they pick screenshots taken with the iphone, the images display correctly, but if they pick images taken with the camera (or take a new photo with the camera), after a short while an image will appear black, followed by every other image appearing black. I’ve tried for days to get rid of this behaviour without any success. The code is pretty straight forward:
if ([[info objectForKey:UIImagePickerControllerMediaType] isEqualToString:@"public.image"]) {
[mediaSource addImage:[info objectForKey:UIImagePickerControllerOriginalImage]];
}
mediaSource adds the image to an NSDictionary, and then the gallery puts this image into a uiimageview when it’s needed, although for testing purposes i’ve tried simply displaying the image straight off, which gives the same result. The key variable here seems to be that it only happens with images from the camera, so perhaps the solution is to somehow remake these images before displaying them again.
Any ideas?
Its not
[info objectForKey:UIImagePickerControllerOriginalImage].Change this to
[info valueForKey:UIImagePickerControllerOriginalImage]and try it.And BTW, what is thumbnail?