{ "id": "172612", "key": "TIMOB-26558", "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": "2018-11-27T03:21:12.000+0000", "created": "2018-11-14T10:47:54.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-27T03:21:13.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Ti.Media.takeScreenshot is not working working properly on iOS. On android, clicking on button its takes a screenshot, saved it to the gallery and displayed it to imageview properly. But on ios we are not getting the same behaviour.\r\n\r\n*Test Code:*\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n layout: \"vertical\",\r\n backgroundColor: \"green\"\r\n });\r\n\r\n var button = Ti.UI.createButton({\r\n title: \"Take Pic\",\r\n top: 20,\r\n width: 200,\r\n height: 200\r\n });\r\n\r\n \r\n\r\n win.add(button);\r\n\r\n\r\n\r\n var imageView = Ti.UI.createImageView({\r\n width: \"100\",\r\n height: \"100\",\r\n top: 20\r\n });\r\n win.add(imageView);\r\n\r\n button.addEventListener('click', function(e) {\r\n\r\n Ti.Media.takeScreenshot(function(e) {\r\n Ti.API.info(e.media);\r\n imageView.image = e.media;\r\n });\r\n\r\n\r\n });\r\n\r\n\r\n\r\n\r\n win.open();\r\n{code}\r\n\r\n*Test Environment:*\r\n\r\n{code}\r\nAppcelerator Command-Line Interface, version 7.0.7\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 7.4.1.GA\r\niOS SDK: 12.0, iOS Simulator: iPhone X\r\n\r\n{code}\r\n\r\n\r\n*Test steps:*\r\n\r\n1. Create a classic project\r\n2. Run the sample code on simulator\r\n3. Click on button. We get the following:\r\n{code}\r\n[INFO] : rakhiAndroid2/1.0 (7.4.1.f47cf79a83)\r\n[INFO] : [object TiBlob]\r\n{code}\r\n\r\n*Console logs and output:* See attachment section for screenshots\r\n\r\n", "attachment": [ { "id": "65851", "filename": "Screenshot_20181114-153042.png", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-11-14T10:48:31.000+0000", "size": 47109, "mimeType": "image/png" }, { "id": "65852", "filename": "Simulator Screen Shot - iPhone X - 2018-11-14 at 16.31.54.png", "author": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-11-14T10:48:31.000+0000", "size": 64446, "mimeType": "image/png" }, { "id": "65901", "filename": "TestCameraImage.zip", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-26T04:56:37.000+0000", "size": 54460, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Ti.Media.takeScreenshot is not working ", "creator": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "rmitro", "key": "rmitro", "displayName": "Rakhi Mitro", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "Appcelerator Command-Line Interface, version 7.0.7\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\n # CPUs = 4\r\n Memory = 8589934592\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version = 7.4.1.GA\r\niOS SDK: 12.0, iOS Simulator: iPhone X", "closedSprints": [ { "id": 1095, "state": "closed", "name": "2018 Sprint 24", "startDate": "2018-11-19T05:35:58.310Z", "endDate": "2018-12-03T05:35:00.000Z", "completeDate": "2018-12-03T16:28:57.549Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "443611", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rmitro] Please add sample test code. Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-15T00:10:07.000+0000", "updated": "2018-11-15T00:10:07.000+0000" }, { "id": "443671", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rmitro] Its working for me. Check with updated test case -\r\n\r\n{code:java}\r\nvar win = Ti.UI.createWindow({\r\n layout: \"vertical\",\r\n backgroundColor: \"green\"\r\n });\r\n\r\n var button = Ti.UI.createButton({\r\n title: \"Take Pic\",\r\n top: 20,\r\n width: 100,\r\n height: 100,\r\n backgroundColor: 'gray'\r\n });\r\n\r\n win.add(button);\r\n\r\n var imageView = Ti.UI.createImageView({\r\n width: \"200\",\r\n height: \"200\",\r\n top: 20,\r\n backgroundColor : 'gray'\r\n });\r\n win.add(imageView);\r\n\r\n button.addEventListener('click', function(e) {\r\n\r\n Ti.Media.takeScreenshot(function(e) {\r\n Ti.API.info(e.media);\r\n imageView.image = e.media;\r\n });\r\n });\r\n win.open();{code}", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-16T04:16:50.000+0000", "updated": "2018-11-16T04:16:50.000+0000" }, { "id": "443676", "author": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "body": "Please try to open camera(Ti.Media.showCamera) with overlay and take screenshot with camera interface opened. It takes screenshot with black screen and overlay, not image from camera...", "updateAuthor": { "name": "max87", "key": "max87", "displayName": "Marian Kucharcik", "active": true, "timeZone": "Europe/Prague" }, "created": "2018-11-16T07:12:49.000+0000", "updated": "2018-11-16T07:12:49.000+0000" }, { "id": "443679", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~max87] Can you give the reproducible test case please? ", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-16T08:35:48.000+0000", "updated": "2018-11-16T08:35:48.000+0000" }, { "id": "443682", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "So here is test case -\r\n\r\n{code:java}\r\n\r\n// -- General UI -- //\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor: \"#fff\"\r\n});\r\n \r\nvar btn = Ti.UI.createButton({\r\n title: \"Open Camera\",\r\n top: 50\r\n});\r\n \r\nvar pic = Ti.UI.createImageView({\r\n width: 200,\r\n height: 200,\r\n bottom: 30,\r\n backgroundColor: \"#ccc\"\r\n});\r\n \r\n// -- Overlay UI -- //\r\n \r\nvar overlay = Ti.UI.createView();\r\nvar takePictureButton = Ti.UI.createButton({\r\n bottom: 10,\r\n right: 10,\r\n title: \"Take ScreenShot!\",\r\n backgroundColor: \"#ff0\",\r\n width: 150,\r\n height: 40\r\n});\r\nvar hideCameraButton = Ti.UI.createButton({\r\n bottom: 10,\r\n left: 10,\r\n title: \"Close Camera!\",\r\n backgroundColor: \"#00f\",\r\n width: 150,\r\n height: 40\r\n});\r\n \r\ntakePictureButton.addEventListener(\"click\", function() {\r\n Ti.Media.takeScreenshot(function(e) {\r\n Ti.API.info(e.media);\r\n pic.image = e.media;\r\n Ti.Media.hideCamera();\r\n });\r\n});\r\n \r\nhideCameraButton.addEventListener(\"click\", function() {\r\n Ti.Media.hideCamera();\r\n});\r\n \r\noverlay.add(takePictureButton);\r\noverlay.add(hideCameraButton);\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n Ti.Media.showCamera({\r\n overlay: overlay,\r\n showControls: false,\r\n autohide: false,\r\n success: function(e) {\r\n pic.image = e.media;\r\n Ti.Media.hideCamera();\r\n },\r\n cancel: function(e) {\r\n Ti.API.warn(\"Cancelled: \" + JSON.stringify(e));\r\n },\r\n error: function(e) {\r\n Ti.API.error(\"Error: \" + JSON.stringify(e));\r\n },\r\n saveToPhotoGallery: false,\r\n allowEditing: false, \r\n mediaTypes: Ti.Media.MEDIA_TYPE_PHOTO\r\n });\r\n});\r\nwin.add(btn);\r\nwin.add(pic);\r\nwin.open();\r\n{code}\r\n\r\nThe code which I can see for taking screenshot is not changed from long. It seems it is expected behaviour for iOS while capturing screenshot. Is it working differently for any previous versions? What is behaviour for android? Will look in this if anything can be done for same.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-16T10:42:50.000+0000", "updated": "2018-11-16T10:42:50.000+0000" }, { "id": "443683", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~rmitro] Can you please check the behaviour for android and let me know? Thanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-16T10:44:16.000+0000", "updated": "2018-11-16T10:44:16.000+0000" }, { "id": "443801", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~vijaysingh], I tested on Android, it takes a screenshot with white screen and overlay, not image from the camera.\r\n\r\nSample code: https://gist.github.com/MotiurRahman/dbe8af54f0b3ba02f0d37bcf4899111c\r\n\r\nThanks!", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-11-21T06:11:40.000+0000", "updated": "2018-11-21T06:14:37.000+0000" }, { "id": "443873", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I have attached a native iOS TestCameraImage app.\r\nI tried to capture screenshot in native app as well. It is also behaving in same way. \r\nWe are using UIImagePickerController to capture image in Titanium. With this it is not possible to capture the camera preview in screenshot. On stack overflow also people have discussed about it [here|https://stackoverflow.com/questions/8996611/ios-capture-screenshot-of-camera-controller] .\r\nThanks!", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-26T05:03:28.000+0000", "updated": "2018-11-26T05:03:28.000+0000" } ], "maxResults": 13, "total": 13, "startAt": 0 } } }