{ "id": "152220", "key": "TIMOB-19757", "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": "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" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2015-10-29T21:41:08.000+0000", "created": "2015-10-21T06:57:52.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "filesystem" ], "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" }, { "id": "16997", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [ { "id": "49548", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "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": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2015-11-24T19:06:19.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" }, { "id": "10207", "name": "Tooling" } ], "description": "{code:title=Environment}\r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.11.1\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 0.10.38\r\n npm Version = 1.4.28\r\nTitanium CLI\r\n CLI Version = 5.0.5\r\nTitanium SDK\r\n SDK Version = 5.2.0.v20151014151229\r\n SDK Path = /Volumes/Data/Users/sebastian/Library/Application Support/Titanium/mobilesdk/osx/5.0.2.GA\r\n Target Platform = iphone\r\n{code}\r\n\r\n{code:title=Example}\r\nvar self = Ti.UI.createWindow({\r\n title: 'file test',\r\n backgroundColor: '#fff'\r\n});\r\n\r\nvar navController = Ti.UI.iOS.createNavigationWindow({\r\n window: self\r\n});\r\n\r\nvar testFile = Ti.Filesystem.getFile(Ti.Filesystem.getResourcesDirectory(), 'KS_nav_ui.png');\r\nalert(testFile.getSize());\r\n\r\nnavController.open();\r\n{code}\r\n\r\nWith SDK 5.0.2.GA the alert gives me 748, with 5.1.x and 5.2.x it alerts 0.\r\n\r\nThere are several problems, not getting files out of the resources directory. Also getting directories with getFile for getDirectoryListing() does not work.\r\n", "attachment": [], "flagged": false, "summary": "Cannot access files in Resources directory with 5.2.x", "creator": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 517, "state": "closed", "name": "2015 Sprint 22 SDK", "startDate": "2015-10-24T00:30:42.059Z", "endDate": "2015-11-07T01:30:00.000Z", "completeDate": "2015-11-09T02:37:29.441Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "367378", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "*Update*\r\nWhy I did not mentioned the bug before (I'm testing with 5.2.x since about 2 weeks): the bug does not appear running the app with tishadow", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T07:07:02.000+0000", "updated": "2015-10-21T07:07:02.000+0000" }, { "id": "367397", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~benutzername], can you try with another file? I noticed that this is a png file that came coupled with the app bundle. In 5.1.X and 5.2.X onward, we actually copy all bundled images into asset catalog, for app thinning purposes. So these files are no longer in the Resources Folder after build. But there shouldn't be a situation whereby you need to getSize of an image file that came bundled in the app. However, it will work for downloaded files during run-time.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T08:59:17.000+0000", "updated": "2015-10-21T08:59:17.000+0000" }, { "id": "367398", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Yes, I can confirm that it works for downloaded files in the data or cache folder.\r\n\r\nIt also happens for jpg files.\r\n\r\nMy first situation: I deliver some background images within my app. I use the directory listing to show the background possibilities and not to take care of a config background image array if I add an image.\r\nSecond situation: I create a pdf file in my app und have to access some image files in my resources directory.\r\n\r\nIs there a way to access the assets?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T09:06:16.000+0000", "updated": "2015-10-21T09:06:16.000+0000" }, { "id": "367399", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Ok I didn't expect these use cases. Will investigate.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T09:22:37.000+0000", "updated": "2015-10-21T09:22:37.000+0000" }, { "id": "367400", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Can I disable app thinning in the tiapp.xml?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T09:24:31.000+0000", "updated": "2015-10-21T09:24:31.000+0000" }, { "id": "367402", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~benutzername], there may be ways to workaround your situations using JS. The fastest way workaround i can think now is to change the extension of your files to be non-image type. then change it back during run-time. (Since we allocate the images into assets catalog only during build). \r\nThe whole purpose of image asset catalog is so that iOS can allocate the right resolution image for the right device in order to save storage space. So it's not as simple if we wish to tackle your situations. As said, we will discuss further internally.\r\nThere's currently no way to disable assets catalogs in the later versions.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T09:39:21.000+0000", "updated": "2015-10-21T09:41:45.000+0000" }, { "id": "367404", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cng] Thanks. Will try that. So it's just renaming the .jpg to .image e.g.?\r\nAnd Appcelerator will not find them as images during the build?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T09:45:19.000+0000", "updated": "2015-10-21T09:45:19.000+0000" }, { "id": "367405", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~benutzername], by the way, do you use any @2x, @3x files?", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T09:45:56.000+0000", "updated": "2015-10-21T09:45:56.000+0000" }, { "id": "367406", "author": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "body": "[~benutzername], yes that's correct.", "updateAuthor": { "name": "cng", "key": "cng", "displayName": "Chee Kiat Ng", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T09:46:23.000+0000", "updated": "2015-10-21T09:46:23.000+0000" }, { "id": "367407", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cng] I always using @2x and @3x files\r\nCould this be a problem while renaming to a non image type?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T09:48:22.000+0000", "updated": "2015-10-21T09:48:22.000+0000" }, { "id": "367411", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "It works so far. Will watch it.", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-21T10:28:08.000+0000", "updated": "2015-10-21T10:28:08.000+0000" }, { "id": "367419", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~cng] The existing use cases (no matter what they are) HAVE to continue to work for it to be named 5.1.0, which would suggest the flag sets asset catalogs OFF by default. Otherwise we need to publish it as 6.0.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-21T13:52:51.000+0000", "updated": "2015-10-21T13:52:51.000+0000" }, { "id": "367486", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/7330\r\n5_1_X: https://github.com/appcelerator/titanium_mobile/pull/7331\r\n\r\nTo enable app thinning, include following property in {{tiapp.xml}}\r\n{{true}}", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-10-22T01:33:09.000+0000", "updated": "2015-10-22T01:39:56.000+0000" }, { "id": "367878", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed. Verified that if I use the sample code above, then I am able to get the file from the Resources directory.\r\n\r\nTested on:\r\n\r\nAppcelerator Studio, build: 4.4.0.201510231805\r\nAppc CLI NPM: 4.2.1-6\r\nAppc CLI Core: 5.1.0-38\r\nArrow: 1.3.13\r\nSDK: 5.1.0.v20151023172822\r\nNode: v4.2.1\r\nOS: El Capitan (10.11.1)\r\nXcode: 7.1\r\nDevices: iphone 6s (9.1), iphone 6 plus (8.3)", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-26T22:21:36.000+0000", "updated": "2015-10-26T22:21:36.000+0000" }, { "id": "367996", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I agree with [~hansknoechel]--this should be under iOS unless you have plans for a similar usage for Android.\r\n\r\nWRT to TIMOB-19489, that's fine. It's a new feature in 5.1.0. If you want to take advantage of it, you have to enable asset catalogs. We just have to make that EXCEPTIONALLY clear when describing the feature.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-27T16:14:14.000+0000", "updated": "2015-10-27T16:14:50.000+0000" }, { "id": "367997", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~hansknoechel] Properties are only supported as a child of the tag. Platform specific properties are not supported, but could be if needed.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-10-27T16:15:25.000+0000", "updated": "2015-10-27T16:15:25.000+0000" }, { "id": "367998", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~cbarber] I would just make it exactly as we do with {{}} and {{}}. Ok?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-27T16:17:01.000+0000", "updated": "2015-10-27T16:17:01.000+0000" }, { "id": "367999", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "That's fine, but these one-off settings must each be explicitly added to the tiapp.xml parser library. Also, these settings will not be known to the Titanium app at runtime. Properties are embedded in the app, settings like {{min-ios-ver}} are not.\r\n\r\nPerhaps it's time to give the tiapp.xml parser some intelligence.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-10-27T16:22:29.000+0000", "updated": "2015-10-27T16:22:29.000+0000" }, { "id": "368002", "author": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "body": "Just to interfere here shortly. Will there be an own section in the docs for all these parameters like *use-app-thinning*, *run-on-main-thread* etc?", "updateAuthor": { "name": "benutzername", "key": "benutzername", "displayName": "Sebastian Klaus", "active": true, "timeZone": "Europe/Berlin" }, "created": "2015-10-27T16:25:37.000+0000", "updated": "2015-10-27T16:26:19.000+0000" }, { "id": "368004", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Master: https://github.com/appcelerator/titanium_mobile/pull/7353\r\n5_1_X: https://github.com/appcelerator/titanium_mobile/pull/7354\r\n\r\nTo enable app thinning, include following property in {{tiapp.xml}} under {{ios}} tag\r\n{{true}}", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-10-27T17:24:00.000+0000", "updated": "2015-10-27T17:24:00.000+0000" }, { "id": "368038", "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": "2015-10-27T22:57:12.000+0000", "updated": "2015-10-27T22:57:12.000+0000" }, { "id": "368350", "author": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed, using:\r\n\r\nMacOS 10.11.2 (15C27e)\r\nStudio 4.4.0.201510280736\r\nTi SDK 5.1.0.v20151028190028\r\nAppc NPM 4.2.1\r\nAppc CLI 5.1.0-38\r\nTi CLI 5.0.5\r\nAlloy 1.7.16\r\nArrow 1.3.13\r\nXcode 7.2 (7C46l)\r\nNode v0.12.7\r\nJava 1.7.0_80\r\nproduction\r\n\r\nUsing the sample code provided, I am able to access the file in the resources directory. The use-app-thinning property is now usable under the ios tag", "updateAuthor": { "name": "ewieber", "key": "ewieber", "displayName": "Eric Wieber", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2015-10-29T21:34:10.000+0000", "updated": "2015-10-29T21:35:00.000+0000" }, { "id": "370992", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~cng] Nope. app thinning is not enabled by default at any time and is only enabled manually.\r\n\r\nPerhaps you're thinking of the launch screen storyboard which will be disabled for existing apps, but enabled for new apps.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-11-20T16:47:17.000+0000", "updated": "2015-11-20T16:47:17.000+0000" }, { "id": "371046", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~cng] Can you please update the wiki so that the information is correct? Thank you!", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-11-21T00:11:46.000+0000", "updated": "2015-11-21T00:11:46.000+0000" }, { "id": "371366", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~bimmel] It's technically \"png\" and \"jpg\". We don't support \"jpeg\".\r\n\r\nI don't like the second sentence. Here, just use this:\r\n\r\n{quote}\r\nWhen enabled, all .png and .jpg images in the {{Resources}} directory will be copied into an asset catalog image set and grouped by filename. High density images are defined with the @2x and @3x suffix. For example, {{foo.jpg}}, {{foo@2x.jpg}}, and {{foo@3x.jpg}} would all be grouped into the same image set. However {{foo@4x.jpg}} would be in its own image set because @4x is not supported and seen as just apart of the filename and not a suffix. For details, see Images and ImageView APIs. Additionally, images that are in the asset catalog are not accessible from the filesystem and thus you cannot reference the images by its path or URL with the Ti.Filesystem API or equivalent. There is currently no way to exclude specific images from being copied into the asset catalog.\r\n{quote}", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2015-11-24T19:06:19.000+0000", "updated": "2015-11-24T19:06:19.000+0000" } ], "maxResults": 48, "total": 48, "startAt": 0 } } }