{ "id": "174343", "key": "TIMOB-27532", "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": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2019-12-03T18:40:02.000+0000", "created": "2019-11-07T16:28:33.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "ACF" ], "versions": [], "issuelinks": [ { "id": "57912", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "174054", "key": "TIMOB-27350", "fields": { "summary": "iOS: httpClient returning image response as undefined.", "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": "None", "id": "6" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2019-12-06T17:49:49.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hello,\r\n\r\nTi.Utils.base64encode(image).toString() is broken on iOS 9 and 10. This function returns [object TiBlob] when it should return the base64 encoded string. On iOS 11, 12, and 13 it works as expected.\r\n\r\n*Test Environment:*\r\nSDK version: 8.2.1.GA\r\nAppcelerator Command-Line Interface, version 7.1.1\r\niOS Device: iPhone 6 plus(12.4.1), iPod 5G (9.3.5)\r\n\r\n*Test Code:*\r\nindex.xml\r\n{code}\r\n\t\r\n\t\t\r\n\t\t\r\n{code}\r\n\r\nindex.js\r\n{code}\r\nvar image = null;\r\n\r\nfunction getImage() {\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess: function(event){\r\n\t\t\timage = event.media;\r\n\r\n\t\t\tvar imageText = Ti.Utils.base64encode(image).toString();\r\n\r\n\t\t\t// Rendering thousands of characters is error prone so \r\n\t\t\t// I trim the string for this proof of concept.\r\n\t\t\tif (imageText.length > 100) {\r\n\t\t\t\timageText = imageText.substring(0, 100);\r\n\t\t\t}\r\n\r\n\t\t \t$.base64Text.text = imageText;\r\n\t\t},\r\n\t\tallowEditing: false,\r\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n}\r\n$.index.open();\r\n{code}\r\n\r\nYou can check the attached project also.\r\n\r\n*Steps to reproduce the issue:*\r\n1. Run the above code on iOS 9 or 10\r\n2. Click on the \"Get Image from Photos\" label and it will choose an image from gallery.\r\n3. You will get *\"[object TiBlob]\"* but it should be returned the base64 encoded string.\r\n\r\nThanks", "attachment": [ { "id": "67111", "filename": "blob-to-string.zip", "author": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2019-11-07T16:26:22.000+0000", "size": 8665196, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Ti.Utils.base64encode(image).toString() Broken on iOS 9 and 10", "creator": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fhaque", "key": "fhaque", "displayName": "Fazlul Haque", "active": false, "timeZone": "America/Los_Angeles" }, "environment": "SDK 8.2.1.GA", "closedSprints": [ { "id": 1170, "state": "closed", "name": "2019 Sprint 23", "startDate": "2019-11-04T18:38:14.526Z", "endDate": "2019-11-17T18:38:00.000Z", "completeDate": "2019-11-18T16:38:18.423Z", "originBoardId": 114 }, { "id": 1171, "state": "closed", "name": "2019 Sprint 24", "startDate": "2019-11-18T16:40:09.114Z", "endDate": "2019-12-01T16:40:00.000Z", "completeDate": "2019-12-02T23:06:24.654Z", "originBoardId": 114 }, { "id": 1172, "state": "closed", "name": "2019 Sprint 25", "startDate": "2019-12-02T23:08:39.644Z", "endDate": "2019-12-15T23:08:00.000Z", "completeDate": "2019-12-16T05:54:54.518Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "452620", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "From SDK 8.1.0.GA, toString() API is broken for TiBlob. Please ask to use property [text|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Blob-property-text] until we properly fix it.\r\n\r\ne.g\r\n var imageText = Ti.Utils.base64encode(image).text;\r\n\r\nUpdated index.js -\r\n\r\n{code:java}\r\nfunction getImage() {\r\n\tTi.Media.openPhotoGallery({\r\n\t\tsuccess: function(event){\r\n\t\t\timage = event.media;\r\n \r\n var imageText = Ti.Utils.base64encode(image).text;\r\n \r\n\t\t\t// Rendering thousands of characters is error prone so \r\n\t\t\t// I trim the string for this proof of concept.\r\n\t\t\tif (imageText.length > 100) {\r\n\t\t\t\timageText = imageText.substring(0, 100);\r\n\t\t\t}\r\n \r\n\t\t \t$.base64Text.text = imageText;\r\n\t\t},\r\n\t\tallowEditing: false,\r\n\t\tmediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO]\r\n\t});\r\n}\r\n$.index.open();\r\n{code}\r\n\r\n\r\n", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-11-12T22:57:55.000+0000", "updated": "2019-11-12T22:57:55.000+0000" }, { "id": "453007", "author": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Duplicate of TIMOB-27350.", "updateAuthor": { "name": "vijaysingh", "key": "vijaysingh", "displayName": "Vijay Singh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2019-12-03T18:40:02.000+0000", "updated": "2019-12-03T18:40:02.000+0000" }, { "id": "453041", "author": { "name": "adampax", "key": "adampax", "displayName": "Adam Paxton", "active": true, "timeZone": "America/New_York" }, "body": "Is TIMOB-27350 internal only ticket? I am unable to view/follow it.", "updateAuthor": { "name": "adampax", "key": "adampax", "displayName": "Adam Paxton", "active": true, "timeZone": "America/New_York" }, "created": "2019-12-05T17:13:26.000+0000", "updated": "2019-12-05T17:13:26.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }