{ "id": "176287", "key": "TIMOB-28535", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "sprint": { "id": 1231, "state": "active", "name": "2021 Sprint 21", "startDate": "2021-10-07T16:05:18.981Z", "endDate": "2021-10-21T16:05:00.000Z", "originBoardId": 219 }, "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": "21249", "name": "Release 10.2.0", "archived": false, "released": false } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-10-20T03:37:25.000+0000", "created": "2021-09-15T21:09:30.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "android", "blob", "mimetype", "webp" ], "versions": [], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-10-20T03:37:25.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": "*Summary:*\r\nWhen loading a WebP image via a Titanium {{Blob}}, the following {{Blob}} APIs fail to read WebP information.\r\n* {{width}}, {{height}}, {{uprightWidth}}, {{uprightHeight}}: Wrongly returns zero.\r\n* {{mimeType}}: Wrongly returns \"audio/x-wav\"\r\n* {{imageAs*()}} and {{imageWith*()}} methods: Always return null.\r\n\r\n*Note:*\r\nAn {{ImageView}} can display a blob's WebP image just fine. This is just an issue with how a {{Blob}} fetches the image's information which may be needed to size/position an image view correctly.\r\n\r\n*Steps to reproduce:*\r\n# Copy attached \"TiLogoOpaque.webp\" to project folder {{Resources/assets/images}}\r\n# Build and run the below code on Android.\r\n# Notice image fails to display. (This is because {{imageAsThumbnail()}} returned null.)\r\n# Notice displayed \"Image Size\" wrongly reads: {{0x0}}\r\n# Notice displayed \"MimeType\" wrongly reads: {{audio/x-wav}}\r\n\r\n{code:java}\r\nconst file = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, \"assets/images/TiLogoOpaque.webp\");\r\nconst blob = file.read();\r\n\r\nconst window = Ti.UI.createWindow();\r\nwindow.add(Ti.UI.createImageView({\r\n\timage: blob.imageAsThumbnail(320, 1, 64),\r\n}));\r\nwindow.add(Ti.UI.createLabel({\r\n\ttext: `Image Size: ${blob.uprightWidth}x${blob.uprightHeight}\\nMime-Type: ${blob.mimeType}`,\r\n\tbackgroundColor: OS_IOS ? \"white\" : \"?android:attr/colorBackground\",\r\n\tbottom: \"30dp\",\r\n}));\r\nwindow.open();\r\n{code}\r\n", "attachment": [ { "id": "67982", "filename": "TiLogoOpaque.webp", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-09-15T21:03:03.000+0000", "size": 54960, "mimeType": "image/webp" } ], "flagged": false, "summary": "Android: Blob fails to read WebP image file info", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "459047", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (titanium_mobile): https://github.com/appcelerator/titanium_mobile/pull/13069", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-09-15T23:42:02.000+0000", "updated": "2021-09-15T23:42:02.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }