UIActivityTypePostToFacebook rotates large images incorrectly
| Originator: | testuttech | ||
| Number: | rdar://12034533 | Date Originated: | Sun, 05 Aug 2012 12:22:40 GMT |
| Status: | Open | Resolved: | |
| Product: | iPhone SDK | Product Version: | 6.0 Beta 3 |
| Classification: | Other bug | Reproducible: | Always |
Summary: When passing a rather large image (i.e. iPad 2 camera photos are too small, but iPhone 4/the new iPad's camera photos are large enough) with an image orientation other than UIImageOrientationUp, the image when uploading to Facebook using the UIActivityTypePostToFacebook is rotated incorrectly. Steps to Reproduce: Pass a large NSData to a UIActivityViewController (do NOT pass a UIImage, as there is a bug which causes UIImages with an imageOrientation other than UIImageOrientationUp to appear orientated incorrectly as well, rdar://12034547. That bug is NOT the same as this bug.), present the UIActivityViewController, and then tap "Facebook". Expected Results: The image is in the same orientation as the one posted Actual Results: The image is in the orientation it would be if it had no imageOrientation set. Regression: Only if the image is larger than a certain size will the image be rotated incorrectly. Notes: I'm guessing the system resizes the photo if it is larger than Facebook's maximum image size, but when it does it doesn't preserve the image orientation. Included is a sample app which demonstrates this issue. This must be run on the new iPad with iOS 6, as that is the only iPad with a high enough camera resolution. First, launch the app and then tap the "Take Picture" button. Take a picture with the device in the orientation UIDeviceOrientationPortrait, UIDeviceOrientationLandscapeLeft, or UIDeviceOrientationLandscapeRight, and then once you're done tap the action button at the bottom of the screen. Tap Facebook, and see the image rotated incorrectly. To confirm this happens with UIImages too, you can uncomment this line in ViewController.m: //#define kUseUIImageAsActivityItem which will cause the app to pass UIImages to the UIActivityViewController. Note however ALL sharing options will have the image rotated incorrectly.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!