{ "id": "165901", "key": "AC-4782", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-02-08T21:53:47.000+0000", "created": "2017-02-08T21:11:29.000+0000", "labels": [ "blob", "image" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-02-08T21:53:51.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": "The Ti.Blob imageAsCompressed function does not appear to exist. I get \"undefined\" is not a function when trying to run it.\r\n\r\nSome code:\r\n\r\n{code:java}\r\n\r\ncompressImage: function(original) {\r\n var image = this.resizeImage(original);\r\n return image.imageAsCompressed(.75);\r\n },\r\n resizeImage: function(original) {\r\n if (original.width < maxWidth && original.height < maxHeight) {\r\n return original;\r\n }\r\n \r\n var aspectRatio = original.width / original.height;\r\n if (original.width <= original.height) { \r\n return original.imageAsResized(aspectRatio * maxHeight, maxHeight); \r\n }\r\n \r\n return original.imageAsResized(maxWidth, maxWidth / aspectRatio);\r\n },\r\n{code}\r\n\r\nThe original is response data from an http call. Note that the imageAsResized works fine. Since that should be returning a blob I would expect the imageAsCompressed function to work as well. I have been using Ti ImageFactory which does work, but wanted to see if the SDK function would be more efficient.", "attachment": [ { "id": "61520", "filename": "Simulator Screen Shot Feb 8, 2017, 4.04.56 PM.png", "author": { "name": "nthurston8", "key": "nthurston8", "displayName": "Nicholas Thurston", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-02-08T21:05:07.000+0000", "size": 95834, "mimeType": "image/png" } ], "flagged": false, "summary": "Ti.Blob imageAsCompressed function does not exist", "creator": { "name": "nthurston8", "key": "nthurston8", "displayName": "Nicholas Thurston", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nthurston8", "key": "nthurston8", "displayName": "Nicholas Thurston", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "OSX 10.12.2\r\nXcode 8.2.1\r\nTitanium SDK 6.0.1.GA\r\nAppcelerator Studio, build: 4.8.1.201612050850", "comment": { "comments": [ { "id": "406629", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "It's will be available in SDK 6.1.0 and later: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Blob-method-imageAsCompressed", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-02-08T21:53:51.000+0000", "updated": "2017-02-08T21:53:51.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }