{ "id": "170175", "key": "AC-5323", "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": "11", "description": "Is not a bug in our product", "name": "Not Our Bug" }, "resolutiondate": "2017-10-30T13:21:36.000+0000", "created": "2017-10-30T09:59:49.000+0000", "labels": [ "iOS", "toImage" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-10-30T13:46:50.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 try to get a image from a group of views or a simple label toImage method returns a invalid Ti.Blob\r\n\r\nThis works fine on Android returning the right Ti.Blob\r\n\r\nSample:\r\n\r\nindex.js\r\n\r\n{code:javascript}\r\n$.addListener($.index, 'open', function(e){\r\n\t$.sample.toImage(function(blob){\r\n\t\t$.img.setImage(blob);\r\n\t});\r\n});\r\n\r\n$.index.open();\r\n{code}\r\n\r\nindex.xml\r\n{code:xml}\r\n\r\n \r\n \r\n\r\n{code}\r\n\r\n[ERROR] Script Error {\r\n[ERROR] column = 27;\r\n[ERROR] line = 42;\r\n[ERROR] message = \"invalid image type\";\r\n[ERROR] nativeLocation = \"-[TiUIImageView setImage_:] (TiUIImageView.m:751)\";\r\n[ERROR] nativeReason = \"expected TiBlob, String, TiFile, was: __NSDictionaryM\";\r\n\r\n !image-2017-10-30-10-58-05-716.png|thumbnail! ", "attachment": [ { "id": "63503", "filename": "image-2017-10-30-10-58-05-716.png", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2017-10-30T09:58:06.000+0000", "size": 24674, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: toImage doesn't returns a valid Ti.Blob", "creator": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "subtasks": [], "reporter": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "environment": null, "comment": { "comments": [ { "id": "429815", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~jormagar],\r\n\r\nThanks for sharing with us. Can you please run the command from your command line: *appc info* and send us the output in a text file?", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2017-10-30T11:03:56.000+0000", "updated": "2017-10-30T11:03:56.000+0000" }, { "id": "429818", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "Hello, please close this issue.\r\n\r\nThe BLOB is inside the callback param:\r\n\r\n$.view.toImage(function(e){\r\n $.img.setImage(e.blob); //It works\r\n}\r\n\r\nPlease, check the documentation, there is a mistake. The callback param should be a dictionary instead a blob. But on Android we are receiving a blob instead a dictionary. Parity discrepance between IOS - Android.\r\n\r\nhttp://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-method-toImage", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2017-10-30T11:36:41.000+0000", "updated": "2017-10-30T11:36:41.000+0000" }, { "id": "429820", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "More info:\r\n\r\nAs you can see in the code, we have a little discrepance.\r\n\r\n{code:javascript}\r\n$.addListener($.index, 'postlayout', function (e) {\r\n $.box.toImage(function (e) {\r\n if (OS_IOS){\r\n $.img.image = e.blob;\r\n } else if (OS_ANDROID) {\r\n $.img.setImage(e);\r\n }\r\n });\r\n});\r\n\r\n$.index.open();\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n\r\n{code}", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2017-10-30T11:50:57.000+0000", "updated": "2017-10-30T11:50:57.000+0000" }, { "id": "429826", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks [~jormagar]. But does it not work on Android when using a dictionary? That'd indeed be a parity issue.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-30T13:22:03.000+0000", "updated": "2017-10-30T13:22:03.000+0000" }, { "id": "429831", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2017-10-30T13:46:20.000+0000", "updated": "2017-10-30T13:46:49.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }