{ "id": "103391", "key": "TIMOB-11484", "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": "14700", "description": "2012 Sprint 25", "name": "2012 Sprint 25", "archived": true, "released": true, "releaseDate": "2012-12-17" }, { "id": "14784", "description": "2012 Sprint 25 API", "name": "2012 Sprint 25 API", "archived": true, "released": true, "releaseDate": "2012-12-17" } ], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2012-12-07T19:49:05.000+0000", "created": "2012-10-15T09:54:12.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "qe-and100112" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-11-07T18:30:39.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "This is not a regression. It exists as far as 2.0.1.\r\n\r\nWhen the value of image is given as '/image/xxx.jpg' , it works fine. But using '../image/xxx.jpg crashes the app which works fine in iOS.\r\n\r\nThis issue is replicated when contentURL value is given as '../xxxx.mp4' instead of '/xxxx.mp4'.\r\n\r\nSteps to reproduce:\r\n1. Use the code below in app.js and paste the attached image of flower in 'images' folder under resource in the app.\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.backgroundColor = 'white';\r\n\r\nvar label = Ti.UI.createLabel({\r\n\ttext: 'ImageView should auto size to image and stay within the blue',\r\n\ttop: 20,\r\n\tleft: 10,\r\n\theight: Ti.UI.SIZE,\r\n\twidth: Ti.UI.SIZE,\r\n\tcolor: 'black'\r\n});\r\n\r\nvar view1 = Ti.UI.createView({\r\n\theight: 30,\r\n\twidth: 60,\r\n\ttop: 80,\r\n\tbackgroundColor: 'red'\r\n});\r\n\r\nvar imageView1 = Ti.UI.createImageView({\r\n\timage: '../images/flower.jpg',\r\n\tbackgroundColor: 'blue'\r\n});\r\n\r\nview1.add(imageView1);\r\nwin.add(view1);\r\nwin.add(label);\r\nwin.open();\r\n{code}\r\n2. Run the app.\r\n\r\nExpected result:\r\n1. App should run and show an imageview with flower image in it.\r\n\r\nActual result:\r\n1. App crashes with null pointer exception.Logs are attached.\r\n", "attachment": [ { "id": "32631", "filename": "flower.jpg", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-15T09:54:12.000+0000", "size": 17766, "mimeType": "image/jpeg" }, { "id": "32632", "filename": "ImageView_Exception.rtf", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-15T09:54:12.000+0000", "size": 6415, "mimeType": "text/rtf" } ], "flagged": false, "summary": "Android: Imageview: App is giving null pointer exception if value of image is given as '../image/xxx.jpg', which works fine for iOS.", "creator": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK: 3.0.0.v20121014181609\r\nTitanium  Studio: 3.0.0.201210141844\r\nDevice : LG-P970 Android 2.2.2\r\nXcode : 4.5 \r\nMachine OS : MAC 10.8", "comment": { "comments": [ { "id": "229688", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The NPE does not show any more on Android using the latest master. But the flower image is not shown with the log:\r\n{code}\r\nD/TiUIImageView( 9239): (main) [82,512] Retrying bitmap decode: 4/5\r\nW/TiDrawableReference( 9239): (AsyncTask #5) [1,513] Bitmap bounds could not be determined. If bitmap is loaded, it won't be scaled.\r\nW/TiDrawableReference( 9239): (AsyncTask #5) [1,514] Could not open stream to get bitmap\r\nD/TiUIImageView( 9239): (main) [167,681] Retrying bitmap decode: 5/5\r\nW/TiDrawableReference( 9239): (AsyncTask #1) [1,682] Bitmap bounds could not be determined. If bitmap is loaded, it won't be scaled.\r\nW/TiDrawableReference( 9239): (AsyncTask #1) [1,683] Could not open stream to get bitmap\r\nE/TiUIImageView( 9239): (main) [1,684] Max retries reached, giving up decoding image source: file:///android_asset/Resources/../images/flower.jpg\r\nD/TiUIImageView( 9239): (main) [81,765] Retrying bitmap decode: 5/5\r\nW/TiDrawableReference( 9239): (AsyncTask #2) [1,766] Bitmap bounds could not be determined. If bitmap is loaded, it won't be scaled.\r\nW/TiDrawableReference( 9239): (AsyncTask #2) [0,766] Could not open stream to get bitmap\r\nE/TiUIImageView( 9239): (main) [1,767] Max retries reached, giving up decoding image source: file:///android_asset/Resources/../images/flower.jpg\r\n{code}\r\nAlso tested on iOS, the flower image is not shown either.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-03T23:13:41.000+0000", "updated": "2012-12-03T23:25:20.000+0000" }, { "id": "230424", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "In the original test case, flower.jpg is under the folder Resources/images, so the expected result should be: App should run without crash but the flower image won't show.\r\n\r\nRun the modified test case below and paste the attached flower.jpg under the folder Resources/images:\r\n{code}\r\n--------------------------- app.js ----------------------------\r\nvar Window = require('ui/win');\r\nnew Window().open();\r\n{code}\r\n{code}\r\n--------------------------- Resources/ui/win.js ----------------------------\r\nfunction ApplicationWindow() {\r\n var self = Ti.UI.createWindow({\r\n backgroundColor:'#ffffff',\r\n navBarHidden:true\r\n });\r\n \r\n\r\n\tvar view = Ti.UI.createView({\r\n\t\theight : 300,\r\n\t\twidth : 300,\r\n\t\ttop : 80,\r\n\t\tbackgroundColor : 'red'\r\n\t});\r\n\r\n\tvar imageView = Ti.UI.createImageView({\r\n\t\timage : '../images/flower.jpg',\r\n\t\tbackgroundColor : 'blue'\r\n\t});\r\n\r\n\tview.add(imageView);\r\n\tself.add(view); \r\n\r\n \r\n return self;\r\n}\r\nmodule.exports = ApplicationWindow;\r\n{code}\r\nExpected Result: App runs without crash and the flower image shows correctly.\r\n\r\nThe original and modified test cases run as expected. Mark the ticket as Cannot Reproduce.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-12-07T19:39:13.000+0000", "updated": "2012-12-07T19:47:55.000+0000" }, { "id": "240506", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Original test case still crashes(gives NPE) with build 3.1.0.v20130228214607 on device LG-P970 Android 2.2.2 but not over other devices.Tested with Samung GALAXY Tab 620\tAndroid 3.2 and Samsung GALAXY Note Android 2.3.6 as well.\nThe modified test case is working fine on all android devices.Image still do not appears on iOS(tested with iphone 5 iOS 6.0 and ipad 3 iOS 6.0) with modified test case.", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-04T08:40:57.000+0000", "updated": "2013-03-04T08:40:57.000+0000" }, { "id": "247037", "author": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Modified case is working fine on android.So closing the bug.", "updateAuthor": { "name": "sbhadauria", "key": "sbhadauria", "displayName": "Shyam Bhadauria", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-11T09:39:30.000+0000", "updated": "2013-04-11T09:39:30.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }