{ "id": "160692", "key": "TIMOB-23462", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2016-06-01T20:49:15.000+0000", "created": "2016-06-01T19:18:56.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:02:02.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": "Hello, In Android, blob.getWidth() returns wrong width value in imageView.\r\n\r\nh5. Step To Reproduce\r\n\r\n1. Put a image in assets/android folder.\r\n2. Use the below Code.\r\n3. Make the change in image name.\r\n4. Run the project.\r\n\r\nindex.xml\r\n{code}\r\n\r\n\t\r\n\t\r\n\r\n{code}\r\n\r\nindex.js\r\n{code}\r\nvar imgView = Ti.UI.createImageView({image:'/images/img_yo_face.png'});\r\nvar blob = imgView.toImage();\r\n\r\nTitanium.API.info (blob.getWidth());\r\n\r\n$.index.open();\r\n{code}\r\n\r\nh5. Observed result\r\n\r\nIn console the \"Titanium.API.info (blob.getWidth());\" return value is 1.\r\n\r\nh5. Expected result\r\n\r\n \"Titanium.API.info (blob.getWidth());\" should return the aclual width value.\r\n\r\nRegards,\r\nSharif\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android: blob.getWidth() returns wrong width value in imageView", "creator": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "environment": null, "comment": { "comments": [ { "id": "387321", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "toImage() is used when you want to transform a view into a bitmap. The view's width and height won't be measure until it is visible on screen. Since the above example did not add the imageView to any window/view, width and height values are not true values. Since you have an imageView, if you want the bitmaps bounds, you can use:\r\n{code}\r\nimgView.toBlob();\r\n{code}\r\n\r\nThat should work even when the view isn't visible.", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-01T20:49:08.000+0000", "updated": "2016-06-01T20:49:08.000+0000" }, { "id": "415613", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:02:02.000+0000", "updated": "2017-03-24T18:02:02.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }