{ "id": "163798", "key": "TIMOB-24001", "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": null, "resolutiondate": null, "created": "2016-10-07T05:55:08.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "engSchedule", "png", "webview" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" }, { "id": "18253", "name": "Release 5.5.0", "archived": false, "released": true, "releaseDate": "2016-09-13" } ], "issuelinks": [], "assignee": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "updated": "2019-08-12T18:01:00.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "PNG and JPG images that exist locally (in the Resources dir) render as broken images in Titanium.UI.WebView components. Images are broken when displayed via both tags and CSS. This is a regression in Ti SDK 5.5.x. Attached is a sample app.js to reproduce the issue. The console displays the following error:\r\n\r\n[ERROR] : Error loading /Users/slim/Library/Developer/CoreSimulator/Devices/F2DACFF8-2866-4B5A-8098-3D817716D753/data/Containers/Bundle/Application/58D9B4CD-13B4-4224-A694-8CD011FED83B/Test.app/KS_nav_ui.png\r\n\r\nNote that remote images (PNG, JPG) seem to render correctly. Also, local GIF images (not tested extensively) and other common assets such as JS and CSS render. Only local PNG and JPG images seem to be affected.\r\n", "attachment": [ { "id": "60452", "filename": "app.js", "author": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-07T05:47:47.000+0000", "size": 168, "mimeType": "text/javascript" }, { "id": "60451", "filename": "KS_nav_ui.png", "author": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-07T05:48:02.000+0000", "size": 748, "mimeType": "image/png" } ], "flagged": false, "summary": "iOS: Local .png and .jpg images do not display in WebView when App-Thinning is enabled", "creator": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Operating System\r\n Name = Mac OS X\r\n Version = 10.11.6\r\n Architecture = 64bit\r\n # CPUs = 8\r\n Memory = 17179869184\r\nNode.js\r\n Node.js Version = 0.12.7\r\n npm Version = 2.11.3\r\nTitanium CLI\r\n CLI Version = 5.0.9\r\nTitanium SDK\r\n SDK Version = 5.5.1.GA\r\n SDK Path = /Users/slim/Library/Application Support/Titanium/mobilesdk/osx/5.5.1.GA\r\n Target Platform = iphone", "closedSprints": [ { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 } ], "comment": { "comments": [ { "id": "398329", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey there! When was the last time it works? So from from version did it break? Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-07T12:14:48.000+0000", "updated": "2016-10-07T12:15:02.000+0000" }, { "id": "398332", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I just tested with both master and 5.5.x, it does work for me, both on Simulator and device. If you navigate to the file in the logs, what is inside the .app file?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-07T12:36:25.000+0000", "updated": "2016-10-07T12:36:25.000+0000" }, { "id": "398337", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Resolving as {{Cannot Reproduce}} for now. I've done multiple tests across our SDK's and am able to see the demo-image in all test-cases.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-07T13:21:06.000+0000", "updated": "2016-10-07T13:21:06.000+0000" }, { "id": "398340", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "I was able to reproduce the issue with our packaged SDK. The issue does occur when app-thinning is enabled ({{true}}). It works with setting it to {{false}}. But since it's {{true}} by default, we need to fix it asap. Technically, it happens because we hash the image-names internally for all SDK-related usages. So we need to come up with a solution for webviews. \r\n\r\n[~cbarber] thoughts? We have the same problem for local images in Hyperloop. Is there no chance to store the assets with their actual name? I know we had problems with the density-suffixes then, but hashing it has some bad side-effects as well. Thx!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-10-07T13:41:44.000+0000", "updated": "2016-10-07T13:41:44.000+0000" }, { "id": "398346", "author": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hans, good catch. I can confirm the issue is caused by \r\n{code}\r\ntrue\r\n{code}\r\nThe workaround is to disable it.", "updateAuthor": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-07T14:22:52.000+0000", "updated": "2016-10-07T14:22:52.000+0000" }, { "id": "398356", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "We have to SHA the filenames of all asset catalog images because the filenames are not unique. If you have an image called {{foo.jpg}} in one asset catalog and {{foo.jpg}} in another, they will collide and only one of them will be resolved. Furthermore, there wasn't a way to hint as to which asset catalog to look for a given image. So, we must SHA the filenames.\r\n\r\nSince you cannot load an image from an asset catalog into the WebView, we have 3 options:\r\n\r\n# Build a generic mechanism to classify and assign metadata to resources. The developer would manually classify which images should not be thinned.\r\n# Rewrite all local image requests to a special URI that resolves a proxy run by the app itself that in turn fetches the image from the asset catalog.\r\n# Do nothing!\r\n\r\nOption 1 will happen, just not in time for Titanium SDK 6.0.\r\n\r\nOption 2 is a hack. It probably won't take long to implement, but first we need to prove it's possible. I could see us possibly using this proxy mechanism to access other resources such as encrypted JS files.\r\n\r\nOption 3 is the path of least resistance. Just tell people to turn off app thinning, or at least until we finish option 1.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-10-07T14:58:08.000+0000", "updated": "2016-10-07T14:58:08.000+0000" }, { "id": "398417", "author": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Chris, from my testing it seems that .gif images are not affected by app thinning. They remain in their original location within the Resources dir and are not moved and/or hashed into Assets.car. If this is the case, another workaround/hack would be to only use .gif images in WebViews. Is this safe to do? If app thinning only touches certain image types/extensions, can you clarify which? Much appreciated.", "updateAuthor": { "name": "slim.mckins", "key": "slim.mckins", "displayName": "Slim McKinsley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-10-08T00:03:28.000+0000", "updated": "2016-10-08T00:03:28.000+0000" }, { "id": "398423", "author": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "body": "[~slim.mckins] Ah, yes. You can safely use .gif images. Titanium will only put .png and .jpg images into image sets: https://github.com/appcelerator/titanium_mobile/blob/master/iphone/cli/commands/_build.js#L4508-L4526.\r\n\r\nWhile image sets support .png, .jpg, and .pdf files (https://developer.apple.com/library/content/documentation/Xcode/Reference/xcode_ref-Asset_Catalog_Format/ImageSetType.html), we chose to not automatically put .pdf files in image sets. .png and .jpg are always images, but .pdf files may be documents.\r\n\r\nSo using .gif files is another workaround.", "updateAuthor": { "name": "cbarber", "key": "cbarber", "displayName": "Chris Barber", "active": true, "timeZone": "America/Chicago" }, "created": "2016-10-08T02:45:17.000+0000", "updated": "2016-10-08T02:45:17.000+0000" }, { "id": "419083", "author": { "name": "pakoartal@gmail.com", "key": "pakoartal@gmail.com", "displayName": "Francisco Carlos Artal Barba", "active": true, "timeZone": "Europe/Madrid" }, "body": "hi,\r\nany update on this?\r\n\r\nthanks!", "updateAuthor": { "name": "pakoartal@gmail.com", "key": "pakoartal@gmail.com", "displayName": "Francisco Carlos Artal Barba", "active": true, "timeZone": "Europe/Madrid" }, "created": "2017-05-04T09:23:24.000+0000", "updated": "2017-05-04T09:23:24.000+0000" }, { "id": "419864", "author": { "name": "support@dataii.com", "key": "support@dataii.com", "displayName": "Szymon Machajewski", "active": true, "timeZone": "America/Detroit" }, "body": "I can confirm that the issue is present in 5.5.1GA. Changing the setting to false in tiapp.xml does fix it:\r\nfalse", "updateAuthor": { "name": "support@dataii.com", "key": "support@dataii.com", "displayName": "Szymon Machajewski", "active": true, "timeZone": "America/Detroit" }, "created": "2017-05-17T04:05:09.000+0000", "updated": "2017-05-17T04:05:09.000+0000" }, { "id": "426938", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "This will be resolved in a future release as part of the general app-thinning changes being made. Until now, the workaround is to disable app-thinning for those use-cases. ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-08-21T07:10:40.000+0000", "updated": "2018-01-23T10:51:00.000+0000" }, { "id": "433571", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~hknoechel], I have tested with the Ti SDK 7.0.1.GA and iPhone 5s v11.2.2 but it does not work with this workaround.\r\n\r\nfalse\r\n\r\nThis is my code\r\n{code}\r\n\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nAnd image file is in the assets folder.\r\n\r\nThanks", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-01-24T08:12:37.000+0000", "updated": "2018-01-24T08:12:37.000+0000" }, { "id": "433572", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "[~morahman] Where exactly did you put the {{}} flag?", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-01-24T08:36:25.000+0000", "updated": "2018-01-24T08:36:25.000+0000" }, { "id": "433640", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "[~hknoechel], I added it inside the tag\r\n\r\n{code}\r\n\r\n true\r\n false\r\n \r\n \r\n UISupportedInterfaceOrientations~iphone\r\n \r\n UIInterfaceOrientationPortrait\r\n \r\n UISupportedInterfaceOrientations~ipad\r\n \r\n UIInterfaceOrientationPortrait\r\n UIInterfaceOrientationPortraitUpsideDown\r\n UIInterfaceOrientationLandscapeLeft\r\n UIInterfaceOrientationLandscapeRight\r\n \r\n UIRequiresPersistentWiFi\r\n \r\n UIPrerenderedIcon\r\n \r\n UIStatusBarHidden\r\n \r\n UIStatusBarStyle\r\n UIStatusBarStyleDefault\r\n \r\n \r\n \r\n{code}\r\n\r\nThanks!", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-01-25T01:36:39.000+0000", "updated": "2018-01-25T01:36:39.000+0000" }, { "id": "437763", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Update: We have discussed this internally and came to the conclusion that it is currently not possible to reference images from the asset catalog in local web views, which is an iOS limitation in general. There are plans to have whitelisted files and/or directories, but that has not been scoped so far. Any contributions to do so are welcome!", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-05-18T15:23:45.000+0000", "updated": "2018-05-18T15:23:45.000+0000" } ], "maxResults": 23, "total": 23, "startAt": 0 } } }