Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26925] IOS: select Image from gallery but got cropped unexpected

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionNot Our Bug
Resolution Date2019-08-02T17:16:50.000+0000
Affected Version/sRelease 8.0.0, Release 7.5.1
Fix Version/sn/a
ComponentsiOS
Labelsapplebug, cropped, engSchedule, gallery, image
ReporterShuo Liang
AssigneeVijay Singh
Created2019-03-27T08:44:00.000+0000
Updated2019-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

FileDateSize
Img.zip2019-04-05T08:27:52.000+00006942206
index.js2019-03-27T08:43:22.000+0000934
originalImage.jpg2019-03-27T08:42:41.000+0000868435
TestCameraImage.zip2019-04-12T23:28:47.000+000053764

Comments

  1. Shuo Liang 2019-04-04

    Any update?
  2. Shuo Liang 2019-04-05

    [~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.
  3. Vijay Singh 2019-04-08

    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.
  4. Vijay Singh 2019-04-12

    I have filed a bug to apple - https://openradar.appspot.com/radar?id=5010761264922624
  5. Vijay Singh 2019-08-02

    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/. "

JSON Source