{ "id": "137963", "key": "TIMOB-18194", "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": "2014-10-11T13:54:48.000+0000", "priority": { "name": "None", "id": "6" }, "labels": [ "TCSupportTriage", "android", "blob", "mimeType" ], "versions": [ { "id": "15972", "description": "Release 3.4.0", "name": "Release 3.4.0", "archived": false, "released": true, "releaseDate": "2014-09-28" }, { "id": "16676", "description": "Release 3.4.1", "name": "Release 3.4.1", "archived": false, "released": true, "releaseDate": "2014-11-14" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:54:49.000+0000", "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" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h4. Problem Description\r\nIf you read a Retina image (with filenames ending in @2x.png or @3x.png) into a blob, the blob does not recognize it as an image because the @ character somehow interferes with the getMimeTypeFromExtension call.\r\n\r\nh4. Steps to reproduce\r\n1. Create a new mobile project (Classic Titanium)\r\n2. In your project, copy Resources/KS_nav_ui.png into Resources/KS_nav_ui@2x.png \r\n3. Paste this code into app.js: \r\n{code}\r\nvar picture1 = 'KS_nav_ui@2x.png';\r\nvar file1 = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, picture1);\r\nvar blob1 = file1.read();\r\nTi.API.info('blob: ' + JSON.stringify(blob1, null, 2));\r\n \r\nvar picture2 = 'KS_nav_ui.png';\r\nvar file2 = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, picture2);\r\nvar blob2 = file2.read();\r\nTi.API.info('blob: ' + JSON.stringify(blob2, null, 2));\r\n {code}\r\n4. Run it into a device\r\n5. Check the output in Ti Studio \r\n\r\nh4. Expected results\r\nSince both files have the same content, should be reported as such. \r\n\r\nh4. Actual Results \r\nHere are the specific results for the same file (KS_nav_ui.png which was copied to KS_nav_ui@2x.png) note that length is OK, and the data is OK, but height, width and mimeType are wrong:\r\n\r\n{code}\r\nARN] : V8Object: (KrollRuntimeThread) [77,77] Runtime disposed, cannot set property 'userAgent'\r\n[WARN] : TiBaseFile: (KrollRuntimeThread) [88,165] Method is not supported org.appcelerator.titanium.io.TiResourceFile : getParent\r\n[INFO] : TiRootActivity: (main) [0,0] checkpoint, on root activity resume. activity = com.negoapps.arrobainfiles.ArrobainfilesActivity@294bd39a\r\n[INFO] : I/Adreno-EGL: : QUALCOMM Build: 10/24/14, 167c270, I68fa98814b\r\n[INFO] : OpenGLRenderer: Initialized EGL, version 1.4\r\n[INFO] : blob: {\r\n[INFO] : \"file\": {\r\n[INFO] : \"hidden\": false,\r\n[INFO] : \"nativePath\": \"file:///android_asset/Resources/KS_nav_ui@2x.png\",\r\n[INFO] : \"writable\": false,\r\n[INFO] : \"executable\": false,\r\n[INFO] : \"parent\": null,\r\n[INFO] : \"readonly\": true,\r\n[INFO] : \"directoryListing\": [],\r\n[INFO] : \"size\": 748,\r\n[INFO] : \"apiName\": \"Ti.Proxy\",\r\n[INFO] : \"name\": \"KS_nav_ui@2x.png\",\r\n[INFO] : \"symbolicLink\": false,\r\n[INFO] : \"bubbleParent\": true\r\n[INFO] : },\r\n[INFO] : \"nativePath\": \"file:///android_asset/Resources/KS_nav_ui@2x.png\",\r\n[INFO] : \"height\": 0,\r\n[INFO] : \"length\": 748,\r\n[INFO] : \"width\": 0,\r\n[INFO] : \"mimeType\": \"application/octet-stream\",\r\n[INFO] : \"apiName\": \"Ti.Blob\",\r\n[INFO] : \"text\": \"�PNG\\r\\n\\u001a\\n\\u0000\\u0000\\u0000\\rIHDR\\u0000\\u0000\\u0000.\\u0000\\u0000\\u0000+\\b\\u0004\\u0000\\u0000\\u0000�}r\\u000f\\u0000\\u0000\\u0002�IDATx\\u0001���K[w\\u001c��wrbj4\\u000f.Y�ώ�m0��VŶ^�����E��boZ)�B�@��\\u0016Z(\\u0005ױ��bc�bs �֋R��m�I��.>������41�$�s�\\u0010\\u0016�\\f<�]5�/���Ë\\u001f|?�c�L\\u0011}�\\\"��Y���G�>��������e\\u0014s����w�\\u0006�j��ؖ�sZ�p��<���\\u001aV�\\u0002M\\u00183\\u0017P\\u0005��٨\\u0002�S��Z�\\u000b�$��mQ�\\u0006.U��\\u001e��B[\\b\\r\\u0006�~�rM�\\u001eG4��v�\\u0018\\u001ee��\\u0004�L�Lf�q�*vf��wN\\nޜ�\\b#� \\u0005��\\u001c��OV)+�K�\\u001dl\\u0019���k]�Q?=���-��\\\"��\\u001b�\\u00161�]w�^��x����7�k7Vq}�Z\\\"����j@�RM\\\"Z\\tƼ��lb�~}����>�=\\u001a���k�ªh[�~{��\\u0012'�\\u0010���r�Xw\\u0005z�\\\\�:�::��%�=Y\\t44�-�Z����\\u0005�V���EA�\\u001a�$=:\\u0016�\\u001cN\\u000e�=�<�I:�\\b�Y<���~�0�\\u0014S���Q\\u001e�\\u0013\\u0012f�\\u0012'j\\u0016W����EܐW�HnP%\\u0012�9\\u0000\\u0000\\u0000\\u0000IEND�B`�\",\r\n[INFO] : \"type\": 1,\r\n[INFO] : \"bubbleParent\": true\r\n[INFO] : }\r\n[WARN] : TiBaseFile: (KrollRuntimeThread) [278,278] Method is not supported org.appcelerator.titanium.io.TiResourceFile : getParent\r\n[INFO] : blob: {\r\n[INFO] : \"file\": {\r\n[INFO] : \"hidden\": false,\r\n[INFO] : \"nativePath\": \"file:///android_asset/Resources/KS_nav_ui.png\",\r\n[INFO] : \"writable\": false,\r\n[INFO] : \"executable\": false,\r\n[INFO] : \"parent\": null,\r\n[INFO] : \"readonly\": true,\r\n[INFO] : \"directoryListing\": [],\r\n[INFO] : \"size\": 748,\r\n[INFO] : \"apiName\": \"Ti.Proxy\",\r\n[INFO] : \"name\": \"KS_nav_ui.png\",\r\n[INFO] : \"symbolicLink\": false,\r\n[INFO] : \"bubbleParent\": true\r\n[INFO] : },\r\n[INFO] : \"nativePath\": \"file:///android_asset/Resources/KS_nav_ui.png\",\r\n[INFO] : \"height\": 43,\r\n[INFO] : \"length\": 748,\r\n[INFO] : \"width\": 46,\r\n[INFO] : \"mimeType\": \"image/png\",\r\n[INFO] : \"apiName\": \"Ti.Blob\",\r\n[INFO] : \"text\": null,\r\n[INFO] : \"type\": 1,\r\n[INFO] : \"bubbleParent\": true\r\n[INFO] : }\r\n{code}\r\n\r\nh4. Extra info\r\nThis used to be a problem if you tried to open a Retina image in a webView but that has apparently been fixed so the mechanism a webView uses to determine mimeType seems to work.", "attachment": [ { "id": "51931", "filename": "RetinaTest.zip", "author": { "name": "jfalcone", "key": "jfalcone", "displayName": "Joe Falcone", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-10-11T13:54:48.000+0000", "size": 1647825, "mimeType": "application/zip" } ], "flagged": false, "summary": "Android: blob does not recognize filenames with \"@\" as images including Retina", "creator": { "name": "jfalcone", "key": "jfalcone", "displayName": "Joe Falcone", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jfalcone", "key": "jfalcone", "displayName": "Joe Falcone", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 3.4.0.GA and older versions\r\nTi Mobile SDK: Mobile SDK 3.4.1\r\nAndroid OS: Android 5.0\r\nTest Device: Nexus 5", "comment": { "comments": [], "maxResults": 1, "total": 1, "startAt": 0 } } }