{ "id": "99175", "key": "TIMOB-12430", "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": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-02-02T01:52:26.000+0000", "created": "2012-08-14T09:00:10.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "image", "resolution" ], "versions": [], "issuelinks": [], "assignee": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-16T20:41:40.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": [], "description": "If you have the following images:\r\n\r\nResources/images/test.png\r\nResources/android/images/test.png\r\nResources/android/images/res-notlong-port-mdpi/test.png\r\n\r\nand somewhere in your code you assign:\r\n\r\nbackgroundImage : '/images/test.png'\r\n\r\nand run it on a res-notlong-port-mdpi device (the emulator at 320x480 is such a device) it would be natural if:\r\n\r\nDESIRED BEHAVIOUR\r\n================\r\n\r\nThe image selected was the one from the specific platform and resolution (Resources/android/images/res-notlong-port-mdpi/test.png)\r\n\r\nIf no platform/resolution specific image is found - look for a platform specific: (Resources/android/images/test.png)\r\n\r\nIf no platform specific image is found, look for the generic image (Resources/images/test.png)\r\n\r\nInstead you get this:\r\n\r\nACTUAL BEHAVIOUR\r\n================\r\n\r\nIs there a generic image (Resources/images/test.png) ?\r\n\r\nIf so use it, and abort further search!\r\n\r\n\r\nCONCLUSION\r\n==========\r\n\r\nThe system ends up preferring images that was NOT meant for the particular device, even though better images are present, meaning you have to code around it and have an elaborate \"which platform and resolution\" logic in the appcode. \r\n\r\nIt is the exact same reversal of logic with 9-patch images. if you have test.png and test.9.png - Ti will always use test.png.\r\n\r\n", "attachment": [], "flagged": false, "summary": "Android images at multiple resolutions are selected in wrong order", "creator": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "environment": "TiSDK 2.1.1GA", "comment": { "comments": [ { "id": "218355", "author": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "body": "I don't seem to be able to reproduce the issue. Which version of Studio are you using? I tested with Studio 2.1.2 and SDK 2.1.2 and looked to be correct.\r\n\r\nLet me know! Thanks.", "updateAuthor": { "name": "dcassenti", "key": "dcassenti", "displayName": "Davide Cassenti", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-09-11T06:02:19.000+0000", "updated": "2012-09-11T06:02:19.000+0000" }, { "id": "218372", "author": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hi Davide,\r\n\r\nDang, I forgot to include that info, sry. It must have been the 2.1.1/2.1.1 combo, but I'm not sure (you can check the date of my submission)\r\n\r\nthis test is on 2.1.2/2.1.2 UBUNTU Linux\r\n\r\nSomething seems to have changed. As far as I can see, imageViews do it right in 2.1.2, but the buttonview does not! (urging you to test imageViews anyway, I did not test in depth)\r\n\r\nI've made at test-case here: http://dl.dropbox.com/u/776614/imagetest.zip\r\n\r\nHere's the test when I run it:\r\n\r\n Run in emulator Android HVGA\r\n ====================\r\n Two buttons with diff. text is shown. \r\n The text is graphical, not a result of the\r\n title attrib.\r\n \r\n Desired result: \r\n \r\n top button: \"9p resolution\" \r\n bottom button: \"Test resolution\"\r\n \r\n 1. Run as is:\r\n \r\n\tresult:\r\n\t\ttop : \"Not button.9.png\" FAIL\r\n\t\tbottom : \"Test Android\" FAIL\r\n \r\n 2. delete (rename) '/images/button.png' and '/images/test.png'\r\n clean project\r\n \trun again\r\n \t\r\n \tresult\r\n \ttop : \"9p resolution\" SUCCESS\r\n \tbottom text : \"Test Android\" FAIL\r\n\r\n 3. delete (rename) '/images/android/res-notlong-port-mdpi/button.9.png' \r\n and '/images/android/test.png'\r\n \r\n clean project\r\n \trun again\r\n \r\n desired result:\r\n \ttop : \"9p android\" \r\n \tbottom text : \"Test Resolution\" \r\n \r\n \t\r\n \tresult\r\n \ttop : \"9p resolution\" SUCCESS \r\n \tbottom text : \"Test Android\" SUCCESS\r\n \r\n", "updateAuthor": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-09-11T09:35:15.000+0000", "updated": "2012-09-11T09:35:15.000+0000" }, { "id": "218373", "author": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "body": "Dang - that very last line should've been\r\n\r\nbottom text : \"Test Resolution\" SUCCESS", "updateAuthor": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-09-11T09:36:44.000+0000", "updated": "2012-09-11T09:36:44.000+0000" }, { "id": "218375", "author": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "body": "Btw - test 1 \"run as is\" is the one that should be successful on both images.", "updateAuthor": { "name": "acebone", "key": "acebone", "displayName": "Esben Maaløe", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-09-11T09:38:55.000+0000", "updated": "2012-09-11T09:38:55.000+0000" }, { "id": "236268", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Hello Esben,\n\nI attempted to run the sample attached. However the 9 patch image is malformed. \n\nh6.i.e. console logs\n{code}\n[ERROR] ERROR: 9-patch image res/drawable-notlong-port-mdpi/button_1aab581dd3.9.png malformed.\n[ERROR] Ticks in transparent frame must be black.\n[ERROR] Found at pixel #84 along bottom edge.\n[ERROR] ERROR: Failure processing PNG image res/drawable-notlong-port-mdpi/button_1aab581dd3.9.png\n[DEBUG] creating unsigned apk: /Users/egomez/Documents/Titanium Studio Workspace/TIMOB-12430/build/android/bin/app-unsigned.apk\n[ERROR] Exception occured while building Android project:\n[ERROR] Traceback (most recent call last):\n[ERROR] File \"/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/android/builder.py\", line 2243, in \n[ERROR] s.build_and_run(True, avd_id, device_args=device_args)\n[ERROR] File \"/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/android/builder.py\", line 2068, in build_and_run\n[ERROR] launched, launch_failed = self.package_and_deploy()\n[ERROR] File \"/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/android/builder.py\", line 1585, in package_and_deploy\n[ERROR] unsigned_apk = self.create_unsigned_apk(ap_)\n[ERROR] File \"/Library/Application Support/Titanium/mobilesdk/osx/2.1.2.GA/android/builder.py\", line 1447, in create_unsigned_apk\n[ERROR] resources_zip = zipfile.ZipFile(resources_zip_file)\n[ERROR] File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/zipfile.py\", line 699, in __init__\n[ERROR] self.fp = open(file, modeDict[mode])\n{code}\n\nWould it work from another working sample in order to replicate what you are seeing?", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-28T19:09:31.000+0000", "updated": "2013-01-28T19:09:31.000+0000" }, { "id": "236990", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing due to inactivity.\r\n\r\nI'd reopen when resources are available in order to replicate what you are seeing.", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-02-02T01:52:26.000+0000", "updated": "2013-02-02T01:52:26.000+0000" }, { "id": "412926", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the information that was requested was never provided.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-16T20:41:40.000+0000", "updated": "2017-03-16T20:41:40.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }