{ "id": "151245", "key": "TIMOB-19597", "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": [ { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-02-02T08:22:18.000+0000", "created": "2015-09-17T16:32:42.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "camera", "module_media", "qe-manualtest", "qe-testadded" ], "versions": [ { "id": "16919", "description": "Critical updates", "name": "Release 4.1.1", "archived": true, "released": true, "releaseDate": "2015-07-15" } ], "issuelinks": [], "assignee": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-02-04T02:00:56.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": "10202", "name": "Android", "description": "Android Platform" } ], "attachment": [], "flagged": false, "summary": "Android: Add previewRect (height, width) to camera callback", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 517, "state": "closed", "name": "2015 Sprint 22 SDK", "startDate": "2015-10-24T00:30:42.059Z", "endDate": "2015-11-07T01:30:00.000Z", "completeDate": "2015-11-09T02:37:29.441Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "364214", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/7201", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-17T16:38:23.000+0000", "updated": "2015-09-17T16:38:23.000+0000" }, { "id": "369175", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "With this PR, user can get the preview size and can use it to size the captured image accordingly.", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-11-06T08:52:53.000+0000", "updated": "2015-11-06T08:52:53.000+0000" }, { "id": "375103", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Reopening as no previewRect is seen in the logs but only cropRect:\r\n{code}\r\n[INFO] : [SAMSUNG-SGH-I747] # SUCCESS : {\"height\":2448,\"width\":3264,\"cropRect\":{\"height\":2448,\"y\":0,\"width\":3264,\"x\":0},\"code\":0,\"media\":{\"file\":{\"hidden\":false,\"nativePath\":\"file:///data/data/com.app.testme/app_appdata/tia1453413346146.jpg\",\"writable\":true,\"executable\":false,\"parent\":{\"hidden\":false,\"nativePath\":\"file:///data/data/com.app.testme/app_appdata\",\"writable\":true,\"executable\":false,\"parent\":{\"hidden\":false,\"nativePath\":\"file:///data/data/com.app.testme\",\"writable\":true,\"executable\":false,\"parent\":{\"hidden\":false,\"nativePath\":\"file:///data/data\",\"writable\":false,\"executable\":false,\"parent\":{\"hidden\":false,\"nativePath\":\"file:///data\",\"writable\":false,\"executable\":false,\"parent\":{\"hidden\":false,\"nativePath\":\"file:///\",\"writable\":false,\"executable\":false,\"parent\":null,\"readonly\":true,\"directoryListing\":[\"sdcard\",\"persist\",\"storage\",\"efs\",\"config\",\"cache\",\"acct\",\"vendor\",\"d\",\"etc\",\"data_3\",\"data_2\",\"data_1\",\"mnt_1\",\"tombstones\",\"firmware\",\"mnt\",\"ueventd.rc\",\"ueventd.qcom.rc\",\"system\",\"sys\",\"sepolicy_version\",\"sepolicy\",\"seapp_contexts\",\"sbin\",\"publiccert.pem\",\"property_contexts\",\"proc\",\"initlogo.rle\",\"init.usb.rc\",\"init.trace.rc\",\"init.target.rc\",\"init.selinux_restore_set.sh\",\"init.selinux_restore.sh\",\"init.selinux_bootanim_stopped.sh\",\"init.ril.sh\",\"init.ril.rc\",\"init.rc\",\"init.qcom.usb.sh\",\"init.qcom.usb.rc\",\"init.qcom.syspart_fixup.sh\",\"init.qcom.sh\",\"init.qcom.rc\",\"init.qcom.early_boot.sh\",\"init.qcom.class_core.sh\",\"init.environ.rc\",\"init.container.rc\",\"init.carrier.rc\",\"init\",\"fstab.qcom\",\"file_contexts\",\"default.prop\",\"data\",\"root\",\"dev\"],\"size\":0,\"apiName\":\"Ti.Proxy\",\"name\":\"\",\"symbolicLink\":false,\"bubbleParent\":true},\"readonly\":false,\"directoryListing\":[],\"size\":4096,\"apiName\":\"Ti.Proxy\",\"name\":\"data\",\"symbolicLink\":false,\"bubbleParent\":true},\"readonly\":false,\"directoryListing\":[],\"size\":12288,\"apiName\":\"Ti.Proxy\",\"name\":\"data\",\"symbolicLink\":false,\"bubbleParent\":true},\"readonly\":false,\"directoryListing\":[\"lib\",\"cache\",\"databases\",\"shared_prefs\",\"app_appdata\"],\"size\":4096,\"apiName\":\"Ti.Proxy\",\"name\":\"com.app.testme\",\"symbolicLink\":false,\"bubbleParent\":true},\"readonly\":false,\"directoryListing\":[\".tilicense\",\"tia1453412750901.jpg\",\"tia1453413346146.jpg\"],\"size\":4096,\"apiName\":\"Ti.Proxy\",\"name\":\"app_appdata\",\"symbolicLink\":false,\"bubbleParent\":true},\"readonly\":false,\"directoryListing\":[],\"size\":1795672,\"apiName\":\"Ti.Proxy\",\"name\":\"tia1453413346146.jpg\",\"symbolicLink\":false,\"bubbleParent\":true},\"nativePath\":\"file:///data/data/com.app.testme/app_appdata/tia1453413346146.jpg\",\"height\":2448,\"length\":1795672,\"width\":3264,\"mimeType\":\"image/jpeg\",\"apiName\":\"Ti.Blob\",\"text\":null,\"type\":1,\"bubbleParent\":true},\"success\":true,\"mediaType\":\"public.image\",\"y\":0,\"x\":0}\r\n{code}\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201601210853\r\nTi SDK : 5.2.0.v20160114021251\r\nTi CLI : 5.0.6\r\nAlloy : 1.7.33\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-1\r\nAppc CLI : 5.2.0-231\r\nNode: v0.12.27\r\nNexus 6P - Android 6.0\r\nGalaxy S3 - Android 4.4.2", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-21T22:07:59.000+0000", "updated": "2016-01-21T22:07:59.000+0000" }, { "id": "375415", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~lchoudhary] Looks like the PR is intended when showCamera is used with overlay and {{takePicture}} is called.\r\n-[~michael] please provide a complete working app.js. -", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-28T10:19:21.000+0000", "updated": "2016-02-01T03:13:24.000+0000" }, { "id": "375423", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~lchoudhary] You can use this app.js\r\n\r\n{code}\r\n var self = Ti.UI.createWindow();\r\n var cameraOverlay = Titanium.UI.createView({\r\n \tbackgroundColor: '#FF00FFAA'\r\n });\r\n \r\n var cameraOverlayButton = Titanium.UI.createImageView({\r\n bottom: 100,\r\n image: '/appcelerator_small.png',\r\n });\r\n cameraOverlay.add(cameraOverlayButton);\r\n \r\n cameraOverlay.addEventListener('click', function(e){\r\n \tTi.API.info(\"taking pic\");\r\n Ti.Media.takePicture();\r\n });\r\n \r\n self.addEventListener(\"postlayout\", postlayoutHandler);\r\n function postlayoutHandler(e) {\r\n self.removeEventListener(\"postlayout\", postlayoutHandler);\r\n Titanium.Media.showCamera({\r\n overlay: cameraOverlay,\r\n showControls: false,\r\n success: function(e) {\r\n Ti.API.info('# SUCCESS : '+ JSON.stringify(e));\r\n },\r\n cancel: function(e) {\r\n Ti.API.info('# CANCEL : '+e.error);\r\n \r\n },\r\n error: function(e) {\r\n Ti.API.info('# ERROR : '+ e.code +' : '+ e.error);\r\n \r\n },\r\n mediaTypes:Ti.Media.MEDIA_TYPE_PHOTO,\r\n });\r\n }\r\n self.open();\r\n{code}\r\n\r\nAlso there is a dependency on TIMOB-19769 which will crash when camera overlay is used. \r\n\r\n", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-01-28T12:11:28.000+0000", "updated": "2016-01-28T12:11:28.000+0000" }, { "id": "375443", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for the example! It only works when takePicture() is called (so not with the basic camera controls). The other callback should be here https://github.com/ashcoding/titanium_mobile/blob/da0ba48a38b07142e53a99ca1af7023ee727af5f/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java#L952 but I need to see how I get the getOptimalPreviewSize() value there", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-01-28T17:58:37.000+0000", "updated": "2016-01-28T18:02:10.000+0000" }, { "id": "375573", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~michael] previewRect makes sense when used with overlay, because native camera control is not used when a overlay is provided in {{showCamera}}. -In such case the {{previewRect}} should be {-1, -1} as with {{cropRect}}.- The same should be updated in docs. \r\nCan you update the PR accordingly ?\r\n\r\n-It can be updated here https://github.com/ashcoding/titanium_mobile/blob/da0ba48a38b07142e53a99ca1af7023ee727af5f/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java#L917-", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-01T04:06:53.000+0000", "updated": "2016-02-02T06:44:00.000+0000" }, { "id": "375629", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Sure I'll do that! Thanks for the hint. Will update the PR in the next days", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-02-01T20:24:57.000+0000", "updated": "2016-02-01T20:24:57.000+0000" }, { "id": "375634", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "output of showCamera without camera overlay will not have previewRect\r\n\r\n{code:javascript}\r\nTitanium.Media.showCamera({\r\n success: function(e) {\r\n Ti.API.info('# SUCCESS : ' + JSON.stringify(e));\r\n },\r\n mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO\r\n });\r\n{code}\r\n\r\n\r\n{code:java}\r\n{\r\n \"y\": 0,\r\n \"x\": 0,\r\n \"height\": 3264,\r\n \"width\": 1836,\r\n \"media\": {\r\n \"file\": {...},\r\n \"nativePath\": \"file:///data/data/com.miga.test/app_appdata/tia1453756826134.jpg\",\r\n \"height\": 3264,\r\n \"length\": 1857467,\r\n \"width\": 1836,\r\n \"mimeType\": \"image/jpeg\",\r\n \"apiName\": \"Ti.Blob\",\r\n \"text\": null,\r\n \"type\": 1,\r\n \"bubbleParent\": true\r\n },\r\n \"mediaType\": \"public.image\",\r\n \"code\": 0,\r\n \"cropRect\": {\r\n \"height\": 3264,\r\n \"width\": 1836,\r\n \"y\": 0,\r\n \"x\": 0\r\n },\r\n \"success\": true\r\n}\r\n{code}\r\n\r\nPR: https://github.com/appcelerator/titanium_mobile/pull/7660", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-01T21:24:03.000+0000", "updated": "2016-02-03T04:31:11.000+0000" }, { "id": "375699", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "Updates to documentation\r\n5_2_X PR: https://github.com/appcelerator/titanium_mobile/pull/7665\r\nmaster PR: https://github.com/appcelerator/titanium_mobile/pull/7666", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-02T06:49:46.000+0000", "updated": "2016-02-02T06:57:10.000+0000" }, { "id": "375700", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "5_2_X (7665) and Master (7666) PR for documentation merged. ", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-02T07:21:55.000+0000", "updated": "2016-02-02T07:21:55.000+0000" }, { "id": "375707", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Should I leave it like it is now (undefined if its not used). Or should I create a correct PR with -1?", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-02-02T08:19:41.000+0000", "updated": "2016-02-02T08:19:41.000+0000" }, { "id": "375708", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~michael] You can leave it like that. We just added the documentation changes. Thanks for the effort!", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-02T08:22:08.000+0000", "updated": "2016-02-02T08:22:08.000+0000" }, { "id": "375823", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~lchoudhary] Sorry for the confusion. We made that behaviour inline with other properties such that it is undefined when not present. \r\nTo recap {{previewRect}} is present when camera overlay is used. Other cases it is undefined. ", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-02-03T04:29:36.000+0000", "updated": "2016-02-03T04:29:36.000+0000" }, { "id": "375964", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the addition of previewRect(height,width). \r\nWe see previewRect in the logs only when camera overlay is used.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 4.5.0.201601262138\r\nTi SDK : 5.2.0.v20160203093451\r\nTi CLI : 5.0.6\r\nAlloy : 1.7.33\r\nMAC Yosemite : 10.10.5\r\nAppc NPM : 4.2.3-2\r\nAppc CLI : 5.2.0-242\r\nNode: 4.2.2\r\nNexus 6P - Android 6.0", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-02-04T01:55:18.000+0000", "updated": "2016-02-04T01:55:18.000+0000" } ], "maxResults": 17, "total": 17, "startAt": 0 } } }