title: UIImage imageOrientation returns 0
body: <p>I am developing an iPhone app in iOS 5. I am using UIImagePickerController to let the user select an image and I need to know the image's orientation. </p>
  
  <p>I have the following code for the UIImagePickerControllerDelegate method when the image has been selected:</p>
  
  <pre><code>-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
      NSString *mediaType = [info objectForKey: UIImagePickerControllerMediaType];
      UIImage *originalImage = nil;
      UIImage *editedImage = nil;
  
      // Handle a still image picked from a photo album
      if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeImage, 0) 
          == kCFCompareEqualTo) {
  
          editedImage = (UIImage *)[info objectForKey:UIImagePickerControllerEditedImage];
          originalImage = (UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage];
  
          NSLog(@"editedImage.imageOrientation = %d", editedImage.imageOrientation);
          NSLog(@"originalImage.imageOrientation = %d", originalImage.imageOrientation);
  
          imageToUse = nil;
          if (editedImage)
              imageToUse = editedImage;
          else 
              imageToUse = originalImage;
  
      }
  }
  </code></pre>
  
  <p>Does anybody know why the imageOrientation values in the NSLog instructions are always 0? I have tried with landscape and portrait images and the result is always the same.</p>
  
  <p>The image selected is not nil, as I am showing it in a UIImageView without problems.</p>
  
  <p>Thanks.</p>