title: Cropping Image changes rotation in iPhone
body: <p>I am using one simple cropping on <code>UIImage</code>, however after cropping when we check the final image, it gets rotated in iPhone. Below is my code used for cropping.</p>
  
  <pre><code>CGRect visibleRect;
  float scale = 1.0f/scrollView.zoomScale;
  visibleRect.origin.x = scrollView.contentOffset.x * scale;
  visibleRect.origin.y = scrollView.contentOffset.y * scale;
  visibleRect.size.width = scrollView.bounds.size.width * scale;
  visibleRect.size.height = scrollView.bounds.size.height * scale;
  finalImage = imageFromView(displayImageView.image, &amp;visibleRect);
  
  UIImage* imageFromView(UIImage* srcImage, CGRect* rect) {
      CGImageRef cr = CGImageCreateWithImageInRect(srcImage.CGImage, *rect);
      UIImage* cropped = [UIImage imageWithCGImage:cr];
  
      CGImageRelease(cr);
      return cropped;
  }
  </code></pre>
  
  <p>Please let me know if i am doing any kind of wrong thing.</p>