{ "id": "153075", "key": "TIMOB-19969", "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": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2016-01-11T21:24:12.000+0000", "created": "2015-11-13T10:15:33.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "appthinning", "imageview", "qe-5.4.0" ], "versions": [ { "id": "14826", "description": "Release 5.1.0-remaining iOS9 features, Android M features", "name": "Release 5.1.0", "archived": false, "released": true, "releaseDate": "2015-11-20" } ], "issuelinks": [ { "id": "50252", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "152502", "key": "TIMOB-19833", "fields": { "summary": "Allow users to access images via Ti.Filesystem when app thinning is enabled", "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": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false } } } } ], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-07-26T23:15:26.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "The attached sample project demonstrates that with app-thinning enabled, you cannot include a suffix in the image path. This works fine with app-thinning disabled.\r\n\r\n1. Build the project with app-thinning enabled and confirm you see the placeholder image\r\n2. Open {{tiapp.xml}} and change {{use-app-thinning}} to {{false}}\r\n3. Build the project again and confirm you see the image.\r\n\r\nThe code where we hash the image path should strip out any suffixes (including {{~iphone}} etc).", "attachment": [ { "id": "57433", "filename": "imagefile.zip", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2015-11-13T10:15:31.000+0000", "size": 10295850, "mimeType": "application/zip" } ], "flagged": false, "summary": "iOS: Problem with suffix like @2x, ~iphone in ImageView source with app-thinning enabled", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 5.1.0.RC (5.1.0.v20151104190037)", "closedSprints": [ { "id": 555, "state": "closed", "name": "2016 Sprint 1 SDK", "startDate": "2016-01-02T01:31:50.127Z", "endDate": "2016-01-16T01:31:00.000Z", "completeDate": "2016-01-18T00:52:43.848Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "373995", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Actually, it's nothing to do with the suffix. It's because it's located in \"Resources/iphone/images/foo@2x.png\"\r\nBut the iOS SDK was treating it as \"Resources/images/foo@2x.png\" when it saw this code\r\n{code}\r\nTi.UI.createImageView({\r\n\timage: 'images/foo@2x.png'\r\n})\r\n{code}\r\n\r\nThat's where the bug is. changing title.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T08:13:00.000+0000", "updated": "2016-01-07T08:13:26.000+0000" }, { "id": "373996", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Another issue is, it can't process `@2x`. It can only accept {{image: 'images/foo.png'}} if app-thinning is enabled. but this may not necessarily be a bug, because when you create image view, it is supposed to find the appropriate resolution image to use that is consistent with the device, so there shouldn't be a need to indicate `@2x` in the first place.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T08:32:00.000+0000", "updated": "2016-01-07T08:32:23.000+0000" }, { "id": "374005", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Your last comment is what I created this ticket for, but are you sure about your preceding comment that you now changed the title of the ticket to? When I use the attached test app (which indeed has the image in {{iphone}}) and modify log what we use [to calculate the hash for the catalog name|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L5050] I don't see it including the platform specific path. It's simply {{images/foo.png}}.\r\n\r\nComing back to the original issue, I think the problem is [here|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/TiUIImageView.m#L507-L521] (and [here|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/Classes/ImageLoader.m#L514-L526]) where we don't strip out suffixes like [we do when we create the asset catalog names|https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L5031], which means it won't be found.", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-01-07T13:24:11.000+0000", "updated": "2016-01-07T13:24:11.000+0000" }, { "id": "374008", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~fokkezb] Sorry i misunderstood the ticket. I understand now after your comment about the suffix. \r\nMy observation on the preceding comment was also erroneous. I was using the new method 'getAsset' that did not manage the path before hashing.\r\nReverting the title and will look at this ticket.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T14:12:01.000+0000", "updated": "2016-01-07T14:12:01.000+0000" }, { "id": "374075", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-08T09:40:06.000+0000", "updated": "2016-01-08T09:40:06.000+0000" }, { "id": "391580", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, I am now able to access images with suffix when app thinning is enabled. \r\nTested on:\r\n{code:java}\r\niPhone 6s (9.3.1) \r\niOS simulator (9.3)\r\n
Mac OSX El Capitan 10.11.6\r\nStudio: 4.7.0.201607130543\r\n
Ti SDK: 5.4.0.v20160725003348\r\n
Xcode: 7.3.1 \r\n
Appc NPM: 4.2.7\r\nAppc CLI: 5.4.0-35\r\nNode: v4.4.4\r\n{code}\r\n\r\n*Closing ticket*", "updateAuthor": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "created": "2016-07-26T23:15:20.000+0000", "updated": "2016-07-26T23:15:20.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }