[TIMOB-26925] IOS: select Image from gallery but got cropped unexpected
GitHub Issue | n/a |
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2019-08-02T17:16:50.000+0000 |
Affected Version/s | Release 8.0.0, Release 7.5.1 |
Fix Version/s | n/a |
Components | iOS |
Labels | applebug, cropped, engSchedule, gallery, image |
Reporter | Shuo Liang |
Assignee | Vijay Singh |
Created | 2019-03-27T08:44:00.000+0000 |
Updated | 2019-08-02T17:16:50.000+0000 |
Description
Reproduce Steps
1. Download any image of resolution(3264 X 2448) for testing purpose. (Attached test image)
2. Run the following example code in a default alloy app.
3. Drag the test image over to simulator.
4. Run the example app, click on the Hello World text of the application and select the testing image from the gallery.
5. Go to simulator folder, then check the saved image. For example in my test, the location is: (~/sliang/Library/Developer/CoreSimulator/Devices/9080930F-2320-4FF3-A042-D7955440EACE/data/Containers/Data/Application/8D3292C5-4578-4B59-8956-29C36AB23BFF/Documents)
Problem
Open the image, you will see the resolution is only 3073 X 2305 and it get cropped at right side and bottom side.
Expect
The image should not get cropped.
Attachments
Any update?
[~vijaysingh] Customer replied that they tried to replicate the issue with a native Xcode project but this issue is not happening there. This is only happening in our project. They are using Xcode 9. Attached is the native project.
I can see that issue is there with iOS 11 & iOS 12 in this case. But it is working fine in iOS 9 and iOS 10. We have introduced manual cropping to have a higher quality of cropped image in TIMOB-7511. I add the original image (3264X2448) in iPhone 6 simulator and run the app on simulator- While debugging I found in - 1. In iOS 10 - [Original image](https://github.com/appcelerator/titanium_mobile/blob/864d8f10b30b5d4fabb4d235a44e715973750c5a/iphone/Classes/MediaModule.m#L1944) dimension - {2668X2001} [Crop rect](https://github.com/appcelerator/titanium_mobile/blob/864d8f10b30b5d4fabb4d235a44e715973750c5a/iphone/Classes/MediaModule.m#L1935) - {2661X1999} [Actual Edited Image](https://github.com/appcelerator/titanium_mobile/blob/864d8f10b30b5d4fabb4d235a44e715973750c5a/iphone/Classes/MediaModule.m#L1921) - {746X560} 2. In iOS 11 - Original image dimension - {3264X2448} Crop rect - {3072X2301} Actual Edited Image - {748X560} 3. In iOS 12 - Original image dimension - {3264X2448} Crop rect - {3073X2305} Actual Edited Image - (750X560) When cropping in simulator the rectangle of simulator is not cropping the image as image is not outside the crop rectangle. So ideally for iOS 10, 11 and 12 the Crop rect should be same as of 'original image dimension' . But in iOS 11 & iOS 12 it is different. Due to wrong crop rect image is getting cropped from bottom and right. So Crop Rect is causing the problem. I'll look in more detail of this.
I have filed a bug to apple - https://openradar.appspot.com/radar?id=5010761264922624
Apple's comment - "Engineering has determined that your bug report is a duplicate of another issue and will be closed. The open or closed status of the original report your bug was duplicated to appears in a text box within the bug detail section of the bug reporter user interface. For security and privacy reasons, we don't provide access to the original bug yours was duped to. If you have any questions or concerns, please update your report directly at this link: https://bugreport.apple.com/. "