This is the kind of bug you have to see for yourself to believe it. UIImagePickerController is one of the oldest classes in iOS and we’ve been using it for just as long to let the user pick images from their photo library. You can also allow “editing” which means the user can select a square region.
Unfortunatley – at least as of iOS 8.1 – the region you select does not match with the resulting cropped image that you are provided. It is shifted down by about 10 pixels from what the user selected.
Filed as rdar://18957593 and on Open Radar.
When allowing the user to select a square part of an image the returned cropped image is shifted substantially showing a different region than selected by the user.
Steps to Reproduce
- Present a UIImagePickerController
- allow cropping
- Select a picture from the photo albums which has details which allow you to verify the selected cropping square
- Take a screenshot before you proceed to show the masked area
- inspect the output of UIImagePickerControllerEditedImage
The area on the edited image should match the selected area from the image picker
The area on the edited image is lower than the previously selected area
iOS 8.1 (12B411)
I am going to attach two images, one shows the cropping view, the other the resulting edited image. As you can see the bottom right red button was outside the cropping region on the screenshot, but is visible in the resulting edited image.
Update November 28th: Created PickerBug sample app upon request by Apple engineer, available in my RadarSamples GitHub repo. Apparently the issue is related to having UIViewControllerBasedStatusBarAppearance NO in info.plist
Categories: Bug Reports