{ "id": "128177", "key": "TIMOB-16742", "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": "2018-08-31T22:00:31.000+0000", "created": "2014-03-26T15:17:58.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [], "versions": [ { "id": "15857", "description": "Release 3.2.2", "name": "Release 3.2.2", "archived": false, "released": true, "releaseDate": "2014-03-09" } ], "issuelinks": [ { "id": "56761", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "162769", "key": "TIMOB-23809", "fields": { "summary": "iOS: Relative images paths are not relative to Resources dir, not current JS file", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "56760", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "113188", "key": "TIMOB-13642", "fields": { "summary": "Android: Remove need for leading slash '/' to load images", "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": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": null, "updated": "2018-08-31T22:00:31.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": "h3. Steps to Reproduce\r\nStarting from the default alloy project, simply copy the {{appicon.png}} under {{app/assets/images/alloy.png}} and notice an inconsistency in the handling of leading '/' of ImageView\r\n\r\nh3. Test case\r\n\r\n*index.xml*\r\n{code:xml} \r\n\r\n\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\r\n\r\n{code} \r\n\r\n*index.tss*\r\n{code:css} \r\n\"TableViewRow\":\r\n{\r\n\tlayout: \"horizontal\",\r\n\theight: Ti.UI.SIZE\r\n},\r\n\"ImageView\":\r\n{\r\n\theight : \"128px\",\r\n\twidth: \"128px\"\r\n}\r\n{code} \r\n\r\n*index.js*\r\n{code:javascript} \r\n$.image1.setImage('/images/alloy.png');\r\n$.image2.setImage('images/alloy.png');\r\n$.image3.setBackgroundImage('/images/alloy.png');\r\n$.image4.setBackgroundImage('images/alloy.png');\r\n\r\n$.win.open();\r\n{code} \r\n\r\nh3. Actual Result\r\n*iOS Simulator:*\r\nImageviews work both with and without leading '/' wether it’s for the image property to the Imageview Property\r\n\r\n*Android:*\r\nImageViews don’t work without leading '/'.\r\n\r\n*Mobileweb deployed in root folder of server (e.g.www.site.com/index.html):*\r\nImageviews work both with and without leading '/' wether it’s for the image property to the Imageview Property\r\n\r\n*Mobileweb deployed elsewhere than the root (e.g. www.site.com/test/index.html):*\r\nImageviews don’t work with leading '/' for the image property.\r\nImageviews work both with and without leading '/' for the backgroundImage property\r\n\r\nh3. Expected Result\r\nThe bare minimum would be for Imageviews to work as expected with the leading '/' for the *image* property wherever the mobile web app is deployed (absolute paths should be considered relative to root of the app). It's already done properly for the *backgroundImage* property, clearly showing it's a bug for the *image* property.\r\n\r\nAdditionally, all platforms should work the same, inconsistencies create the unnecessary need for customized code/files per platform.", "attachment": [], "flagged": false, "summary": "Android: Inconsistency in the handling of leading '/' of ImageView", "creator": { "name": "kayl", "key": "kayl", "displayName": "Kevin Frugier", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "kayl", "key": "kayl", "displayName": "Kevin Frugier", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium Studio 3.2.1", "comment": { "comments": [ { "id": "298909", "author": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Moving this ticket to engineering as I can reproduce this issue on Android with the provided test case. Same test works on iOS as expected.", "updateAuthor": { "name": "ragrawal", "key": "ragrawal", "displayName": "Ritu Agrawal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-03-27T04:55:17.000+0000", "updated": "2014-03-27T04:55:17.000+0000" }, { "id": "441267", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "There are 2 separate issues here:\r\n# Android and iOS handle relative file paths differently. On Android, paths are relative to the JS file. On iOS, paths are always relative to the app's \"Resources\" directory (ie: the working directory). We've written up this parity different in [TIMOB-23809].\r\n# Android does have a bug where it always fails to load images if the path does not have a leading slash. This is a bug with how it constructs paths. See [TIMOB-13642]. The {{Ti.Filesystem.getFile()}} API does not have this problem.\r\n\r\nFor now, I recommend that you stick to absolute paths with leading slashes. This is the most portable solution.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-08-31T21:59:58.000+0000", "updated": "2018-08-31T21:59:58.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }