{ "id": "148500", "key": "TIMOB-18982", "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": "16723", "description": "Windows Platform Support, ListView updates, Vector overlays in maps", "name": "Release 4.1.0", "archived": false, "released": true, "releaseDate": "2015-07-08" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-06-12T05:30:41.000+0000", "created": "2015-06-04T20:24:59.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "regression" ], "versions": [], "issuelinks": [], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2015-06-16T23:06:54.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": "When using certain Blob methods on Android I will get an error message like the following:\r\n\r\n_Message: Uncaught TypeError: Object # has no method 'imageAsCropped'_\r\n\r\nI have tested the following methods, none of which worked on Android and all of which worked correctly on iOS.\r\n\r\n* imageAsCropped\r\n* imageAsResized\r\n* imageAsThumbnail\r\n* imageWithAlpha\r\n* imageWithRoundedCorner\r\n* imageWithTransparentBorder\r\n\r\nTest code:\r\n\r\n\r\n{code:java}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor:'#fff',\r\n layout: 'vertical'\r\n});\r\nwin.open();\r\n\r\nvar greenBox = Titanium.UI.createView({\r\n backgroundColor: '#0f0',\r\n top: 50,\r\n left: 50,\r\n height: 50,\r\n width: 50\r\n});\r\nwin.add(greenBox);\r\n\r\nvar blob = greenBox.toImage();\r\nvar boxAsImage = Titanium.UI.createImageView({\r\n image: blob,\r\n top: 50,\r\n left: 50,\r\n height: 50,\r\n width: 50\r\n})\r\nwin.add(boxAsImage);\r\n\r\nvar cropped = blob.imageAsCropped({\r\n height: 10,\r\n width: 10,\r\n x: 10,\r\n y: 10\r\n});\r\n\r\nvar thumbImage = Titanium.UI.createImageView({\r\n image: cropped,\r\n top: 50,\r\n left: 50\r\n})\r\nwin.add(thumbImage);\r\n{code}\r\n\r\nOn iOS this will display two 50px green squares with a third 10px green square underneath, while on Android, only the first two squares will be displayed (see screenshots).", "attachment": [ { "id": "55737", "filename": "Screen Shot 2015-06-04 at 4.04.15 PM.png", "author": { "name": "Yissachar Radcliffe", "key": "yissachar radcliffe", "displayName": "Yissachar Radcliffe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-04T20:05:57.000+0000", "size": 34425, "mimeType": "image/png" }, { "id": "55736", "filename": "Screen Shot 2015-06-04 at 4.05.10 PM.png", "author": { "name": "Yissachar Radcliffe", "key": "yissachar radcliffe", "displayName": "Yissachar Radcliffe", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-04T20:07:47.000+0000", "size": 88689, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Blob methods do not work", "creator": { "name": "Yissachar Radcliffe", "key": "yissachar radcliffe", "displayName": "Yissachar Radcliffe", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "Yissachar Radcliffe", "key": "yissachar radcliffe", "displayName": "Yissachar Radcliffe", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Android 5\r\nNexus 4, Nexus 5\r\nTitanium 3.5.0, 3.5.1, 4.1.0 ", "closedSprints": [ { "id": 416, "state": "closed", "name": "2015 Sprint 12 SDK", "startDate": "2015-06-06T00:00:43.862Z", "endDate": "2015-06-20T00:00:00.000Z", "completeDate": "2015-06-23T05:41:35.834Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "354914", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master PR: https://github.com/appcelerator/titanium_mobile/pull/6907\r\ntesting code:\r\n{code}\r\nvar win = Titanium.UI.createWindow({\r\n backgroundColor:'#fff',\r\n layout: 'vertical'\r\n});\r\nwin.open();\r\n \r\nvar greenBox = Titanium.UI.createView({\r\n backgroundColor: '#0f0',\r\n top: 50,\r\n left: 50,\r\n height: 50,\r\n width: 50\r\n});\r\nwin.add(greenBox);\r\n \r\nvar blob = greenBox.toImage();\r\nvar boxAsImage = Titanium.UI.createImageView({\r\n image: blob,\r\n top: 50,\r\n left: 50,\r\n height: 50,\r\n width: 50\r\n})\r\nwin.add(boxAsImage);\r\n \r\nvar cropped = blob.imageAsCropped({\r\n height: 10,\r\n width: 10,\r\n x: 10,\r\n y: 10\r\n});\r\n\r\nvar logoimage = Titanium.UI.createImageView({\r\n image:cropped\r\n});\r\nwin.add(logoimage);\r\n{code}", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-11T19:57:33.000+0000", "updated": "2015-06-11T19:57:33.000+0000" }, { "id": "355271", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix.\r\n\r\nBlob methods work as expected.\r\n\r\nEnvironment:\r\nAppc Studio : 4.1.0.201505071004\r\nTi SDK : 4.1.0.v20150614181235\r\nTi CLI : 4.0.1\r\nAlloy : 1.6.2\r\nMAC Yosemite : 10.10.3\r\nAppc npm : 4.0.1\r\nAppc CLI : 4.0.2\r\nNode: v0.10.37\r\nAndroid 5.0.2", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-06-16T21:48:10.000+0000", "updated": "2015-06-16T21:48:10.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }