title: PHImageManager returning images with incorrect orientation on device
body: <p>I provide the user the ability to pick photos from their camera roll to upload to the server.</p>
  
  <p>The orientation appears correct in the camera roll.</p>
  
  <p>When I use the simulator (iphone5, iphone6 etc..) everything works as expected and the orientation of the photo is correct when uploaded to the server.</p>
  
  <p>When I attach a device and select a photo the image is always oriented 90 CCW. If I logout image.imageOrientation right before saving the result I can see its '3' meaning UIImageOrientationRight.</p>
  
  <p>Does anyone have any insight why on the device its 90 CCW and on simulator is correct?</p>
  
  <p>Here is my code:</p>
  
  <p>(event.eventAttachments is an array of PHAssets)</p>
  
  <pre><code>__block NSMutableArray *images = [[NSMutableArray alloc] init];
  
  PHImageRequestOptions *options = [[PHImageRequestOptions alloc] init];
  options.networkAccessAllowed = YES;
  options.synchronous = YES;
  
  for(id asset in event.eventAttachments) {
    CGFloat scale = [UIScreen mainScreen].scale;
    CGSize targetSize = CGSizeMake(CGRectGetWidth([UIScreen mainScreen].bounds) * scale, CGRectGetHeight([UIScreen mainScreen].bounds) * scale);
    [[PHImageManager defaultManager] requestImageForAsset:asset
      targetSize:targetSize
      contentMode:PHImageContentModeAspectFit
      options:options
      resultHandler:^(UIImage *result, NSDictionary *info) {
      if (result) {
        NSMutableDictionary *imageDict = [[NSMutableDictionary alloc] init];
        [imageDict setObject:result forKey:@"image"];
        [imageDict setObject:[NSString stringWithFormat:@"image.jpg"] forKey:@"name"];
        [images addObject: imageDict];
      }
    }];
  
  }
  </code></pre>
  
  <p>I NSLog the image.UIImageOrientation and I see 3. </p>
  
  <p>EDIT: wanted to add that if I use my device, and I go onto google images and download a random image and then select that image the orientation is correct. </p>
  
  <p>So the orientation is only wrong for photos that have been taken with a device. Because the simulator I am using the 'stock' images that come with the simulator (since I can't take photos with my simulator).</p>