{ "id": "176290", "key": "TIMOB-28537", "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": "21201", "description": "", "name": "Release 10.1.0", "archived": false, "released": true, "releaseDate": "2021-09-28" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2021-09-23T20:40:15.000+0000", "created": "2021-09-20T21:12:55.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "ImageView", "android", "regression", "scaling" ], "versions": [ { "id": "21201", "description": "", "name": "Release 10.1.0", "archived": false, "released": true, "releaseDate": "2021-09-28" } ], "issuelinks": [], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2021-09-23T20:40:15.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\nAs of 10.1.0, the new ImageView [scalingMode|https://titaniumsdk.com/api/titanium/ui/imageview.html#scalingmode] property which defaults to [Ti.Media.IMAGE_SCALING_AUTO|https://titaniumsdk.com/api/titanium/media.html#image_scaling_auto] is supposed to stretch the image disproportionally if both the \"width\" and \"height\" properties are defined. If only 1 of the \"width\" or \"height\" properties are defined (or neither), then it's supposed to do a [Ti.Media.IMAGE_SCALING_ASPECT_FIT|https://titaniumsdk.com/api/titanium/media.html#image_scaling_aspect_fit] which is a letterbox scale. This is to match the old scaling behavior before Titanium 10.1.0.\r\n\r\nAs of 10.1.0.RC, setting both \"width\" and \"height\" with the default {{Ti.Media.IMAGE_SCALING_AUTO}} mode no longer stretches the image disproportionally anymore on Android. It's always doing a letterbox scale.\r\n\r\n*Steps to reproduce:*\r\n# Build and run the below on Android.\r\n# Notice the image is wrongly scaled proportionally when it should be stretched width-wise.\r\n\r\n{code:javascript}\r\nconst win = Ti.UI.createWindow();\r\nwin.add(Ti.UI.createImageView({\r\n\timage: \"https://raw.githubusercontent.com/appcelerator/titanium_mobile/master/templates/app/angular-default/template/DefaultIcon.png\",\r\n\twidth: Ti.UI.FILL,\r\n\theight: 30,\r\n}));\r\nwin.open();\r\n{code}\r\n\r\n*Result:*\r\nNotice the image is proportionally scaled to the \"height\" property's value of 30. This is wrong since both \"width\" and \"height\" properties are defined. _(The below would only be correct if only the \"width\" property was defined.)_\r\n !Bad.png|thumbnail! \r\n\r\n*Expected Result:*\r\nThe image should be stretched as follows.\r\n !Good.png|thumbnail! \r\n", "attachment": [ { "id": "67984", "filename": "Bad.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-09-20T21:10:50.000+0000", "size": 403599, "mimeType": "image/png" }, { "id": "67983", "filename": "Good.png", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-09-20T21:10:50.000+0000", "size": 412820, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: IMAGE_SCALING_AUTO not stretching ImageView if both width/height is set as of 10.1.0", "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, "closedSprints": [ { "id": 1229, "state": "closed", "name": "2021 Sprint 20", "startDate": "2021-09-22T22:04:35.181Z", "endDate": "2021-10-06T22:04:00.000Z", "completeDate": "2021-10-07T15:37:04.863Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "459055", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/13077", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2021-09-20T21:33:32.000+0000", "updated": "2021-09-20T21:33:32.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }