{ "id": "163229", "key": "TIMOB-23910", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-01-01T19:35:01.000+0000", "created": "2016-09-15T15:15:15.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "ios10", "native_issue", "showcamera", "uiimagepickercontroller" ], "versions": [], "issuelinks": [], "assignee": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-24T18:59:41.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "When adding a transform to on Ti.Media.showCamera, the transform is not applied.\r\n\r\n{code:java}\r\nvar cameraTransform = Ti.UI.create2DMatrix().scale(1.5,1.5);\r\nTi.Media.showCamera({\r\n showControls: false,\r\n autohide: false,\r\n animated: true,\r\n overlay: cameraControls.getView(),\r\n success: function (e) {\r\n //do something\r\n },\r\n error: function (e) {\r\n Ti.API.error(JSON.stringify(e));\r\n }\r\n });\r\n{code}\r\nAlso applying the trasform directly on the sdk is ignored.\r\n\r\n{code:java}\r\n float cameraAspectRatio = 4.0 / 3.0;//whatever values you set here are ignored when built on iOS10\r\n float camViewHeight = screenSize.width * cameraAspectRatio;\r\n float scale = screenSize.height/camViewHeight;\r\n \r\n CGAffineTransform translate = CGAffineTransformMakeTranslation(0, (screenSize.height - camViewHeight) / 2.0);\r\n picker.cameraViewTransform = CGAffineTransformScale(translate, scale, scale);\r\n{code}\r\nIt's probably related to this: [http://stackoverflow.duapp.com/questions/39124794/uiimagepickercontrollers-cameraviewtransform-is-ignoring-scaling-and-transla/39342257#39342257]", "attachment": [], "flagged": false, "summary": "iOS 10: 2D transforms not applied in Ti.Media.showCamera", "creator": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Xcode 8, iOS 10, Titanium 5.5.0.GA", "comment": { "comments": [ { "id": "396222", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Forgot to add the transform on showCamera, but of course that's what I'm doing on my tests\r\n", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-15T15:19:47.000+0000", "updated": "2016-09-15T15:20:40.000+0000" }, { "id": "396227", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "And this is the correct SO link [http://stackoverflow.com/questions/39124794/uiimagepickercontrollers-cameraviewtransform-is-ignoring-scaling-and-transla/39342257#39342257]", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-15T15:59:43.000+0000", "updated": "2016-09-15T15:59:43.000+0000" }, { "id": "396431", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Well, the second one is obviously failing because of some more configuration and graphics-context being required. If the first one works with iOS 9.3, I will investigate it. But not that your demo-code is still invalid, since you don't even use the {{cameraTransform}} after it's creation.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T11:17:00.000+0000", "updated": "2016-09-17T11:17:00.000+0000" }, { "id": "396432", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "In the example code I've forgot to add the transform, but it really doesn't work (I already pointed that out in a previous comment)\r\nIn MediaModule.m , doesn't matter what aspect ratio you set, the values are ignored on iOS 10, although they work as expected on 9.3.5", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T11:38:54.000+0000", "updated": "2016-09-17T11:38:54.000+0000" }, { "id": "396433", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "The Obj C code in the second example is an excerpt from MediaModule.m", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T11:40:22.000+0000", "updated": "2016-09-17T11:40:22.000+0000" }, { "id": "396435", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, but the snippet alone won't help to reproduce it. I have a valid test-case now, but as many native devs run into the same issue with iOS 10 GM, hopefully Apple comes with a fix for this soon. There is a workaround that I will test as well. And does it work without the {{overlay}} property supplied?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T12:04:52.000+0000", "updated": "2016-09-17T12:24:23.000+0000" }, { "id": "396439", "author": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "I tested many cases, I think also without the overlay, but I'll confirm asap. I couldn't edit the Jira ticket description, that's why you have the test case without the transform property set.\r\nIt's indeed an iOS 10 issue, I also made a ticket at Apple's. I have to make a custom camera to capture LivePhoto's so I'll eventually stop using UIImagePicker.\r\nI'll do a full native test to confirm. Almost sure it's an Apple bug, but I thought it was worth letting you guys know", "updateAuthor": { "name": "rlustemberg", "key": "rlustemberg", "displayName": "Richard Lustemberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T14:57:11.000+0000", "updated": "2016-09-17T14:57:11.000+0000" }, { "id": "396440", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yep, very thankful for that. I will file a [bug report at Apple|bugreport.apple.com] next week as well. For now, I updated [the docs|https://github.com/appcelerator/titanium_mobile/blob/master/apidoc/Titanium/Media/Media.yml#L1660] so people are aware of the issue. Thanks again!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-09-17T15:07:47.000+0000", "updated": "2016-09-17T15:07:47.000+0000" }, { "id": "403939", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Apple resolved this issue in iOS 10.2. Demo-code to test:\r\n{code:js}\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar btn = Ti.UI.createButton({\r\n title: 'Trigger'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tvar cameraTransform = Ti.UI.create2DMatrix().scale(3, 3);\r\n\tTi.Media.showCamera({\r\n transform: cameraTransform,\r\n success: function (e) {\r\n //do something\r\n },\r\n error: function (e) {\r\n Ti.API.error(JSON.stringify(e));\r\n }\r\n });\t\r\n});\r\n\r\nwin.add(btn);\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-01-01T19:35:01.000+0000", "updated": "2017-01-10T16:29:49.000+0000" }, { "id": "415727", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket with reference to the previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:59:41.000+0000", "updated": "2017-03-24T18:59:41.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }