title: Sometimes UIImageView seems to reject the image taken with iPhone Camera
body: <p>it is very strange, because this error doesn't happen all the time...</p>
  
  <p>I have the following code:</p>
  
  <pre><code>- (IBAction)getPhoto:(id)sender {
    UIImagePickerController * picker = [[UIImagePickerController alloc] init];
    picker.delegate = self;   
  #if TARGET_IPHONE_SIMULATOR
    picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;    
  #else   
    picker.sourceType = UIImagePickerControllerSourceTypeCamera;  
  #endif
    [self presentModalViewController:picker animated:YES];
  }
  </code></pre>
  
  <p>with the corresponding delegated selector</p>
  
  <pre><code>- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
    UIImage *image = [[info objectForKey:@"UIImagePickerControllerOriginalImage"] imageByScalingToSize:CGSizeMake(480, 320)];
    [[self imageView] setImage:image];
    [picker dismissModalViewControllerAnimated:YES];
  }
  </code></pre>
  
  <p>strange thing is, somtimes the image appears in imageView and sometimes not. I have called<br>
  (gdb) po UIImagePNGRepresentation(image)<br>
  right after setImage and stuffed the output into a file. The file is a perfect png.</p>
  
  <p>Has anyone experienced the same? Has anyone found a solution for it?</p>
  
  <p>Thanks in advance</p>
  
  <p>Max</p>