{ "id": "117137", "key": "TIMOB-14540", "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": "15597", "description": "2013 Sprint 17", "name": "2013 Sprint 17", "archived": true, "released": true, "releaseDate": "2013-08-23" }, { "id": "15599", "description": "2013 Sprint 17 API", "name": "2013 Sprint 17 API", "archived": true, "released": true, "releaseDate": "2013-08-23" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-16T23:22:10.000+0000", "created": "2013-07-12T13:16:39.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "mobilesdk", "module_media", "qe-testadded", "titanium" ], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "issuelinks": [ { "id": "30355", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "116375", "key": "TIMOB-14532", "fields": { "summary": "Android: blob.imageAsResized causes java error", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "32059", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "118406", "key": "TIMOB-14852", "fields": { "summary": "Android: Image View does not render all the images captured using device Camera", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:44:08.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" } ], "description": "*Problem*\r\nWhen using the imageAsResized function on a blob it causes a java memory error when using a device which has a camera with 6 megapixels or more.\r\n\r\nI used the code below on the Galaxy S3, and a lot of times it causes an error, sometimes it doesn't. When i set the camera to 3.2 megapixels for example the issue doesn't occur.\r\n\r\n*Steps to reproduce*\r\n1. Tap Open Camera\r\n2. Take photo\r\n3. Save photo\r\n4. Repeat until Runtime Error appears (see attachment)\r\n\r\n*Test case*\r\n{code:javascript}\r\nvar win1 = Titanium.UI.createWindow({\r\n\ttitle : 'cameratest',\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nvar button = Titanium.UI.createButton({\r\n\tcolor : '#999',\r\n\ttitle : 'Open camera'\r\n});\r\n\r\nwin1.add(button);\r\n\r\nbutton.addEventListener(\"click\", function(e) {\r\n\tTi.Media.showCamera({\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\r\n\t\tsuccess : function(e) {\r\n\t\t\tvar width = e.media.width, height = e.media.height, scaleFactor = Math.sqrt((width * height ) / (1600 * 1200 ));\r\n\r\n\t\t\tif (scaleFactor > 1) {\r\n\t\t\t\twidth /= scaleFactor;\r\n\t\t\t\theight /= scaleFactor;\r\n\r\n\t\t\t\tvar image = e.media.imageAsResized(width, height);\r\n\t\t\t}\r\n\t\t}\r\n\t});\r\n});\r\n\r\nwin1.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: blob.imageAsResize causes java error", "creator": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "subtasks": [], "reporter": { "name": "anigam", "key": "anigam", "displayName": "Ashish Nigam", "active": true, "timeZone": "Asia/Kolkata" }, "environment": "Titanium Mobile SDK, Android", "comment": { "comments": [ { "id": "263768", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This OutOfMemoryError happens because the image size is too big and the GC does not kick in in time. We cannot control when the GC kicks in, so the developers need to take care of memory wisely.\r\nSent PR https://github.com/appcelerator/titanium_mobile/pull/4509 to handle the error gracefully so the app won't crash any more.\r\nFor FR, please run the above test case on Galaxy S3 and follow step 1-4 and should not see any crash.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-29T21:38:34.000+0000", "updated": "2013-07-29T22:30:36.000+0000" }, { "id": "275911", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "App is running fine with no error, tried several times.\r\n\r\nVerified fix on:\r\nDevice: Samsung S3, Android version: 4.1.1\r\nSDK: 3.2.0.v20131018154951\r\nCLI version : 3.2.0\r\nOS : MAC OSX 10.8.4\r\nAlloy : 1.2.2\r\nAppcelerator Studio, build: 3.2.0.201310181700\r\nXCode : 5", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-21T10:52:18.000+0000", "updated": "2013-10-21T10:52:18.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }