{ "id": "135373", "key": "TIMOB-17632", "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": null, "resolutiondate": null, "created": "2014-08-27T11:14:33.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupport", "openCamera", "takePicture" ], "versions": [ { "id": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:07.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description \r\nAfter I openCamera(), I try to takePicture() and following error appears in console:\r\n\r\n{code}\r\n[ERROR] : TiMedia: (KrollRuntimeThread) [1110,1110] Camera preview is not open, unable to take photo\r\n{code}\r\nBut preview is opening and working well..\r\n\r\n\r\nHello,\r\nWe have tested this issue. Ti.Media.takePicture() only works on the overlay. But when we take the photo it continuously capture the photo on the galaxy s3 real device. It's a valid bug.\r\n\r\nh4. Steps to Reproduce\r\n1. Create classic project.\r\n2. Paste this file in app.js file.\r\n{code:title=app.js}\r\nvar win1 = Titanium.UI.createWindow({\r\n\tbackgroundColor : '#fff',\r\n\tlayout : 'vertical'\r\n});\r\n\r\nvar frmcamera = Ti.UI.createButton({\r\n\tbackgroundColor : '#ff0000',\r\n\ttitle : 'Open Camera',\r\n\tcolor : '#fff',\r\n\twidth : Ti.UI.SIZE,\r\n\theight : Ti.UI.SIZE,\r\n\ttop : 10\r\n\r\n});\r\n\r\nfrmcamera.addEventListener('click', function() {\r\n\tfireUpTheCamera();\r\n\r\n});\r\n\r\nwin1.add(frmcamera);\r\n\r\nvar overlay = Ti.UI.createView({\r\n\twidth : 80,\r\n\theight : 80,\r\n\tbottom : 20\r\n});\r\n\r\n// Create a Button.\r\nvar btn = Ti.UI.createButton({\r\n\ttitle : 'Take',\r\n\theight : 60,\r\n\twidth : 60\r\n\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tTi.Media.takePicture();\r\n});\r\noverlay.add(btn);\r\n\r\nfunction fireUpTheCamera() {\r\n\tTitanium.Media.showCamera({\r\n\r\n\t\tsuccess : function() {\r\n\t\t\tconsole.log('taken');\r\n\t\t},\r\n\t\tsaveToPhotoGallery : true,\r\n\t\tautohide : false,\r\n\t\toverlay : overlay,\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n\r\n}\r\n\r\nwin1.open();\r\n\r\n{code}\r\n3. Run it in device attached to Android Monitor", "attachment": [], "flagged": false, "summary": "Android: takePicture(): Camera preview is not open, unable to take photo", "creator": { "name": "shirk3y", "key": "shirk3y", "displayName": "Mateusz Golewski", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "shirk3y", "key": "shirk3y", "displayName": "Mateusz Golewski", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Ti Studio 3.3.0.201407100905 Android 4.4.2 Genymotion simulator\r\nTitanium SDK: 3.3.0.GA\r\nTitanium CLI: 3.3.0,\r\nAndroid SDK: 4.3, samsung Galaxy s3,\r\niOS: 7.1,\r\nOS X Version: 10.9.4,\r\nAppcelerator Studio: 3.3.0", "comment": { "comments": [ { "id": "320570", "author": { "name": "shirk3y", "key": "shirk3y", "displayName": "Mateusz Golewski", "active": true, "timeZone": "Europe/Berlin" }, "body": "Regarding to the source: \r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java#L420\r\n\r\nand\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/master/android/modules/media/src/java/ti/modules/titanium/media/MediaModule.java#L293\r\n\r\ntakePicture() works only if overlay is set.", "updateAuthor": { "name": "shirk3y", "key": "shirk3y", "displayName": "Mateusz Golewski", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-08-27T14:20:45.000+0000", "updated": "2014-08-27T14:21:21.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }