{ "id": "118463", "key": "TIMOB-14875", "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": "15422", "description": "Release 3.3.0", "name": "Release 3.3.0", "archived": false, "released": true, "releaseDate": "2014-07-16" }, { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-06-20T22:27:21.000+0000", "created": "2013-08-13T23:02:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "module_network", "qe-testadded" ], "versions": [ { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" } ], "issuelinks": [ { "id": "31352", "type": { "id": "10000", "name": "Blocks", "inward": "is blocked by", "outward": "blocks" }, "outwardIssue": { "id": "119117", "key": "MOD-1507", "fields": { "summary": "SyncServer: Memory leak on Android", "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": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-24T22:51: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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "HTTP requests that return non-image data (e.g. content-type of 'application/json') are processing the content as potential images and thus are generating extraneous messages in the console saying \"SkImageDecoder::Factory returned null\". This is also adding overhead to every non-image HTTP request (albeit minor).\r\n\r\nI tracked it down to the 'loadBitmapInfo' method that is called in 'blobFromData' (line 182 in TiBlob.java), which is called from 'handleEntityData' (line 358 in TiHTTPClient.java). It looks like the logic on line 216 in TiBlob.java is incorrect:\r\n\r\n{code}\r\nif (mt == null || mt.startsWith(\"image/\")) {\r\n{code}\r\n\r\nShould be\r\n\r\n{code}\r\nif (mimetype == null || mimetype.startsWith(\"image/\")) {\r\n{code}\r\n\r\nWhat is happening is that 'guessContentTypeFromStream' is returning null for 'application/json' type data (which is correct, but it means that 'mt' is null) and it ends up thinking that the data should be processed as an image, when in fact the mimetype value is 'application/json' and thus should not be processed as a potential image.\r\n\r\nLooks like the wrong variable is being checked on line 216 of TiBlob.java. I did a quick test and changed the logic to the latter and the warning messages went away.\r\n\r\nTo reproduce:\r\n\r\n1) Issue an Ti.Network.HTTPClient request that returns JSON text\r\n\r\nNote in the log the \"SkImageDecoder::Factory returned null\" message\r\n", "attachment": [], "flagged": false, "summary": "Android: HTTP requests generate SkImageDecoder message for non-image responses", "creator": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "jenglish", "key": "jenglish", "displayName": "Jeff English", "active": true, "timeZone": "America/Chicago" }, "environment": "SDK: 3.1.1", "closedSprints": [ { "id": 133, "state": "closed", "name": "2014 Sprint 13 SDK", "startDate": "2014-06-23T21:55:20.791Z", "endDate": "2014-07-04T00:00:00.000Z", "completeDate": "2014-07-07T17:32:18.561Z", "originBoardId": 100 } ], "comment": { "comments": [ { "id": "283224", "author": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "body": "I can confirm this issue. HTTP requests asking for a XML in the reply cause numerous messages of SkImageDecoder::Factory returned null.", "updateAuthor": { "name": "bedengler", "key": "bedengler", "displayName": "Bernhard Dengler", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-12-09T17:21:47.000+0000", "updated": "2013-12-09T17:22:11.000+0000" }, { "id": "289242", "author": { "name": "ndegroot", "key": "ndegroot", "displayName": "Nico de Groot", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Bug still seems present in 3.2.0 version", "updateAuthor": { "name": "ndegroot", "key": "ndegroot", "displayName": "Nico de Groot", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-22T17:40:29.000+0000", "updated": "2014-01-22T17:40:29.000+0000" }, { "id": "309011", "author": { "name": "yuchi", "key": "yuchi", "displayName": "Pier Paolo Ramon", "active": true, "timeZone": "Europe/Berlin" }, "body": "Still present on 3.3.0.RC. This is a trivial issue with a simple solution, provided in the description.", "updateAuthor": { "name": "yuchi", "key": "yuchi", "displayName": "Pier Paolo Ramon", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-06-13T22:06:58.000+0000", "updated": "2014-06-13T22:06:58.000+0000" }, { "id": "309051", "author": { "name": "vkorol", "key": "vkorol", "displayName": "Viktor Korol", "active": true, "timeZone": "Europe/Istanbul" }, "body": "Please fix it.", "updateAuthor": { "name": "vkorol", "key": "vkorol", "displayName": "Viktor Korol", "active": true, "timeZone": "Europe/Istanbul" }, "created": "2014-06-14T03:27:12.000+0000", "updated": "2014-06-14T03:27:12.000+0000" }, { "id": "309833", "author": { "name": "wood1k", "key": "wood1k", "displayName": "Alexey Chulochnikov", "active": true, "timeZone": "Europe/Helsinki" }, "body": "Can you please fix it?", "updateAuthor": { "name": "wood1k", "key": "wood1k", "displayName": "Alexey Chulochnikov", "active": true, "timeZone": "Europe/Helsinki" }, "created": "2014-06-19T13:40:28.000+0000", "updated": "2014-06-19T13:40:28.000+0000" }, { "id": "309834", "author": { "name": "Nastya", "key": "nastya", "displayName": "Nastya Lytvyn", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Still present, +1 to fix it!", "updateAuthor": { "name": "Nastya", "key": "nastya", "displayName": "Nastya Lytvyn", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-19T13:41:04.000+0000", "updated": "2014-06-19T13:41:04.000+0000" }, { "id": "310281", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Testing Code:\r\n{code}\r\nvar xhr = Titanium.Network.createHTTPClient();\r\nxhr.onreadystatechange = function()\r\n{\r\n Ti.API.info(\"xhr.onreadystatechange\");\r\n}\r\n// open the client\r\nxhr.open('GET','http://www.appcelerator.com/assets/The_iPad_App_Wave.pdf');\r\n \r\n// send the data\r\nxhr.send();\r\n{code}\r\n\r\nmaster PR: https://github.com/appcelerator/titanium_mobile/pull/5832\r\n3.3.X PR: https://github.com/appcelerator/titanium_mobile/pull/5833", "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-20T21:45:59.000+0000", "updated": "2014-06-20T22:09:27.000+0000" }, { "id": "310789", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix using the test code.\r\nWe do not get \" SkImageDecoder::Factory returned null\" logs anymore.\r\n\r\nClosing.\r\n\r\nEnvironment:\r\nAppc Studio : 3.3.0.201406231625\r\nTi SDK : 3.3.0.v20140624130120\r\nMac OSX : 10.8.5\r\nAlloy : 1.4.0-rc2\r\nCLI - 3.3.0-rc2\r\nCode Processor: 1.1.1\r\nNexus 5 - android 4.4.4", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-06-24T22:51:25.000+0000", "updated": "2014-06-24T22:51:25.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }