{ "id": "141387", "key": "AC-745", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2015-09-29T01:28:04.000+0000", "created": "2014-12-10T09:47:53.000+0000", "labels": [ "Android", "Camera", "Overlay", "TCSupportTriage" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:37:00.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "When using an overlay with Ti.Media.showCamera() on Android, the resulting preview shows a zoomed in version of the final picture that is taken.\r\n\r\nOn taking the photo, the actual photo is displayed for a moment within the preview view, and it is visibly different.\r\n\r\n\r\n{code:title=Camera.js.|borderStyle=solid}\r\nfunction ModuleConstructor(_params) {\r\n var self = Ti.UI.createWindow();\r\n var cameraOverlay = Titanium.UI.createView({});\r\n \r\n var cameraOverlayButton = Titanium.UI.createImageView({\r\n bottom: 10,\r\n image: '/images/camera_btn.png',\r\n });\r\n cameraOverlay.add(cameraOverlayButton);\r\n \r\n cameraOverlayButton.addEventListener('click', function(e){\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 : '+e.success);\r\n ...code etc...\r\n },\r\n cancel: function(e) {\r\n Ti.API.info('# CANCEL : '+e.error);\r\n ...code etc...\r\n },\r\n error: function(e) {\r\n Ti.API.info('# ERROR : '+ e.code +' : '+ e.error);\r\n ...code etc...\r\n },\r\n mediaTypes:Ti.Media.MEDIA_TYPE_PHOTO,\r\n });\r\n }\r\n return self;\r\n};\r\n \r\nmodule.exports = ModuleConstructor;\r\n{code}", "attachment": [ { "id": "56089", "filename": "motog2_640.mov", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-06T08:21:30.000+0000", "size": 1083517, "mimeType": "video/quicktime" }, { "id": "56088", "filename": "nexus4_640.mov", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-06T08:21:35.000+0000", "size": 1720601, "mimeType": "video/quicktime" } ], "flagged": false, "summary": "Camera preview is different to taken image on Android with overlay", "creator": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "environment": "3.4.0 GA | Android | Sony Xperia running 4.1.2", "comment": { "comments": [ { "id": "336353", "author": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "body": "Were you able to reproduce the issue?\r\nDo you need additional information from me?", "updateAuthor": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "created": "2014-12-15T09:27:51.000+0000", "updated": "2014-12-15T09:27:51.000+0000" }, { "id": "336739", "author": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "body": "I would really appreciate a response as to whether this is a bug, and if there is a workaround, or a pending fix.\r\nI realise that a fix may not be done in time for my current project, but at the moment the project is on hold until I can find a definitive answer to the issue.\r\nThanks!", "updateAuthor": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "created": "2014-12-17T07:10:12.000+0000", "updated": "2014-12-17T07:10:12.000+0000" }, { "id": "345438", "author": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "body": "Could someone give some indication of what the process / timescale for this issue will be?\r\n\r\nThanks!", "updateAuthor": { "name": "oshevans", "key": "oshevans", "displayName": "Osian Evans", "active": true, "timeZone": "Europe/London" }, "created": "2015-03-09T11:25:03.000+0000", "updated": "2015-03-09T11:25:03.000+0000" }, { "id": "355488", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Is it possible to get the preview image width/height?\r\nIf you read this page: http://androblip.huiges.nl/2010/07/25/camera-preview-size-picture-size-and-scaling/\r\n_\"It seems that on the G1 the standard previewsize you get is 320 x 480, while the picture size is something like 1536 x 2048. A quick thinker sees that the preview is 2:3, while the picture is ofcourse 3:4\"_\r\n\r\nold phone but with my moto g2 I still have a difference between the size of the preview image and the actual photo. And when you have a overlay image and want to adjust the image its difficult when the image size differs.", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-06-18T17:54:56.000+0000", "updated": "2015-06-18T17:54:56.000+0000" }, { "id": "356775", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can't compile the whole sdk but something like this:\r\n{code}\r\nstatic public KrollDict getPreviewSize(){\r\n\t\tKrollDict dict = new KrollDict();\r\n\r\n\t\tif (optimalPreviewSize!==null){\r\n\t\t\tdict.put(\"width\",optimalPreviewSize.width);\r\n\t\t\tdict.put(\"height\",optimalPreviewSize.height);\r\n\t\t} else {\r\n\t\t\tdict.put(\"width\",0);\r\n\t\t\tdict.put(\"height\",0);\r\n\t\t}\r\n\t\treturn dict;\r\n}\r\n{code}\r\n\r\nin https://github.com/appcelerator/titanium_mobile/blob/17dc8754653daaff170ea0c18f74218168a5633e/android/modules/media/src/java/ti/modules/titanium/media/TiCameraActivity.java should probably work", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-02T19:53:11.000+0000", "updated": "2015-07-02T19:53:11.000+0000" }, { "id": "356944", "author": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "body": "[~oshevans] we can not replicate this issue, can you please send us more information in order to help us to reproduce the issue?\r\n\r\nThanks", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2015-07-06T02:13:52.000+0000", "updated": "2015-07-06T02:13:52.000+0000" }, { "id": "356957", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can create a video and attach it later. E.g. Nexus 4 and Moto G2 produce different result", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-06T06:22:23.000+0000", "updated": "2015-07-06T06:22:23.000+0000" }, { "id": "356963", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "Attached the screen recordings. Make sure to watch them with Quicktime! VLC wasn't showing all frames!\r\n\r\nMoto G2: with overlay has a bigger image once the image was taken. Without the overlay the image size is the same as the preview size\r\n\r\nNexus 4: with and without overlay the images look the same after taking the photo (although the preview image looks a bit stretched when you turn the camera (will upload a video of that in the evening)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-07-06T08:24:36.000+0000", "updated": "2015-07-06T08:24:36.000+0000" }, { "id": "362647", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "any update here, do you need more information? Would like to see the preview-size added to the camera module", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-09T11:30:52.000+0000", "updated": "2015-09-09T11:30:52.000+0000" }, { "id": "364217", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-09-17T16:51:20.000+0000", "updated": "2015-09-17T16:51:20.000+0000" }, { "id": "365171", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Marking this resolved. Will request to process the pull request.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-09-29T01:28:04.000+0000", "updated": "2015-09-29T01:28:04.000+0000" }, { "id": "365609", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~michael] Does previewRect property should be applied on the final preview image ?", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-10-02T03:12:45.000+0000", "updated": "2015-10-02T03:12:45.000+0000" }, { "id": "365647", "author": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "body": "@ssombhatla you mean inside the pull request? I've added it so it can be used like the croppedrect. When you just look at the preview (live camera) it looks fine but once the image is taken it will use a different image size (device depending) and I you are using overlays or need to positioning the camera image it will be different.\r\nE.g. I present an overlay with a box the user has to be inside. When taking the image the result will be different and you can't adjust the overlay because you don't know what the preview size was. With this pull request you should be able to adjust the overlay (according to: http://androblip.huiges.nl/2010/07/25/camera-preview-size-picture-size-and-scaling/)", "updateAuthor": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-02T11:14:11.000+0000", "updated": "2015-10-02T11:14:11.000+0000" }, { "id": "366037", "author": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~michael]\r\nLooks like this is an undocumented issue in Android Camera API and happens on specific devices. \r\nThe anomaly in preview and final picture is because of horizontal field of view being greater in the final picture which is a result of preview and final picture having different aspect ratio. This results in extending both horizontal sides which are not visible in preview. Hence applying a cropped rect from (0,0) will not show the correct image as expected. \r\n", "updateAuthor": { "name": "ssombhatla", "key": "ssombhatla", "displayName": "Srikanth Sombhatla", "active": false, "timeZone": "Asia/Singapore" }, "created": "2015-10-07T06:44:17.000+0000", "updated": "2015-10-07T06:44:17.000+0000" } ], "maxResults": 21, "total": 21, "startAt": 0 } } }