UIImagePickerControllerCropRect is not giving proper rectangle when cropping image of high resolution ~(3264X2448) in iOS 11 and iOS 12

Originator:s.vijayvikram
Number:rdar://49866214 Date Originated:12th April 2019
Status:Open Resolved:
Product:iOS Product Version:11.x/12.x
Classification:Bug Reproducible:Always
 
Area:
UIKit

Summary:
In iOS 11.x/12.x while cropping an image of photo library using UIImagePickerController is giving wrong value for cropped rectangle found using UIImagePickerControllerCropRect. It happens for  high resolution  ~(3264X2448).

Steps to Reproduce:
1. Unzip the attached project TestCameraImage.zip. Open TestCameraImage.xcode project in Xcode 10.2. and run on simulator iPhone 6 having iOS 12.2.
2.  Download attached image originalImage.jpg . Drag image and drop it on simulator iPhone 6 having iOS 12.2.
3. Launch the app TestCameraImage. 
4. Click on button 'Open'. Select the image originalImage from Photogalary. Do not zoom image.
5. Click on 'Choose' button.
6. See the log result on screen. It says -
  Original image size is ~ {3264, 2448}
  Edited image size is ~ {750, 560}
  Crop rect is ~ {0, 0, 3072, 2302}
7. If we see cropping rectangle in step 4, it has complete image inside. So ideally Original Image size should be approximately equal to crop rect size. But it is different.

  
Note - In our SDK we are using the UIImagePickerControllerCropRect  to give the high resolution edited image.

Expected Results:
Original image size should be approximately equal to crop rect size .

Actual Results:
Original image has different size than crop rect size as we see in step 6.

Version/Build:
Xcode 10.2, iOS 12.2

Configuration:

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!