{ "id": "152502", "key": "TIMOB-19833", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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:22:27.000+0000", "created": "2015-10-30T10:34:57.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "appthinning", "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" }, "outwardIssue": { "id": "153075", "key": "TIMOB-19969", "fields": { "summary": "iOS: Problem with suffix like @2x, ~iphone in ImageView source with app-thinning 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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "49548", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "152220", "key": "TIMOB-19757", "fields": { "summary": "Cannot access files in Resources directory with 5.2.x", "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": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-07-26T23:14:08.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": "Because of TIMOB-19757 we have made app-thinning of image assets optional (for existing projects).\r\n\r\nThis means that when a developer needs to have access to an image via {{Ti.Filesystem.getFile()}} he has to disable app-thinning for *all* images.\r\n\r\nWe need a better solution for this.\r\n\r\nSome thoughts:\r\n\r\n* Provide away to exclude images from asset catalogs\r\n** (n) Requires new folder or meta file\r\n* Modify {{Ti.Filesystem.getFile()}} to find images in asset catalogs\r\n** (n) Requires hack to recognise image requests under resourceDirectory and translate that to {{[UIImage imageNamed:@\"my-name\"];}}\r\n* Add {{Ti.Filesystem.getAsset()}} to get an asset via {{[UIImage imageNamed:@\"my-name\"];}}\r\n** (y) Looks like the best option.", "attachment": [], "flagged": false, "summary": "Allow users to access images via Ti.Filesystem when app thinning is 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": null, "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": "373997", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Ti.Filesystem.getAsset(file path of bundled image) shall return a blob. This makes the method more versatile, allowing the developer the choice of saving it as a file in any location.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T08:41:06.000+0000", "updated": "2016-01-07T08:41:06.000+0000" }, { "id": "373998", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "PR here: https://github.com/appcelerator/titanium_mobile/pull/7622\r\n\r\nh4. Steps to test:\r\n1. create a new classic project\r\n2. include in tiapp.xml\r\n{code}\r\n\t\r\n \ttrue\r\n{code}\r\n3. include any image, `foo.png` in *Resources/images/foo.png*\r\n4. Run this sample code\r\nSample Code:\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: '#fff'\r\n});\r\n\r\nvar imageView = Ti.UI.createImageView();\r\nwin.add(imageView);\r\n\r\n//get image blob using getAsset\r\nvar imageBlob = Ti.Filesystem.getAsset('images/foo.png');\r\n\r\n//create a file based on the blog\r\nvar filename = Ti.Filesystem.applicationDataDirectory + 'blog_image.png';\r\nf = Ti.Filesystem.getFile(filename);\r\nf.write(imageBlob);\r\nTi.API.info(f);\r\n\r\n//set image on imageView based on file\r\nimageView.setImage(f);\r\n\r\nwin.open();\r\n{code}\r\n\r\nh4. Expected Result\r\nYou will see the image shown in the imageView.\r\n\r\nh4. Extra Tests\r\nyou can include more images named *foo@2x.png*, *foo~iphone.png* and retest with *Ti.Filesystem.getAsset('images/foo@2x.png')* and *Ti.Filesystem.getAsset('images/foo~iphone.png')* respectively, you will still see the image.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T08:46:18.000+0000", "updated": "2016-01-08T09:38:49.000+0000" }, { "id": "374000", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "[~cng] I don't even think we could return a file since assets in asset catalogs (except for AppIcon and LaunchImage) are compressed into a single {{Assets.car}} file?\r\n\r\nI assume writing to a file in the example is for the purpose of demonstration since you could just assign the blob to the ImageView's {{image}} property as well?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2016-01-07T10:00:50.000+0000", "updated": "2016-01-07T10:00:50.000+0000" }, { "id": "374001", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Yes that was my intention.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2016-01-07T10:12:28.000+0000", "updated": "2016-01-07T10:12:28.000+0000" }, { "id": "374197", "author": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FT and CR approved. Thanks Kiat! Merging.", "updateAuthor": { "name": "apetkov", "key": "apetkov", "displayName": "Angel Petkov", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-11T21:22:53.000+0000", "updated": "2016-01-11T21:22:53.000+0000" }, { "id": "391578", "author": { "name": "jlongton", "key": "jlongton", "displayName": "Josh Longton", "active": true, "timeZone": "Europe/London" }, "body": "Verified as fixed, I am now able to access images using Ti.Filesystem 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:13:53.000+0000", "updated": "2016-07-26T23:13:53.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }