{ "id": "89517", "key": "TIMOB-8545", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2017-06-12T19:41:24.000+0000", "created": "2012-04-04T15:36:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-06-12T19:41:24.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": "When the imageview has no valid width or height we dont scale the underlying bitmap. This is extremely problematic since the resulting bitmap loaded into memory can be very large. We should have a default level of scaling based on screen size reported by the window manager in order to avoid run away memory usage. This can be tested with the KS camera test and setting the imageview width and height (in the success callback) to Ti.UI.FILL.\r\n\r\nExample log output resulting:\r\n{code}\r\n\r\n04-04 16:24:06.869 21034 21034 E GraphicsJNI: VM won't let us allocate 10036224 bytes\r\n04-04 16:24:06.869 21034 21034 D skia : --- decoder->decode returned false\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: (main) [8,524579] Unable to load bitmap. Not enough memory: bitmap size exceeds VM budget\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: java.lang.OutOfMemoryError: bitmap size exceeds VM budget\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat android.graphics.BitmapFactory.nativeDecodeStream(Native Method)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:459)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:285)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.view.TiDrawableReference.getBitmap(TiDrawableReference.java:521)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat ti.modules.titanium.ui.widget.TiUIImageView.setImage(TiUIImageView.java:748)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat ti.modules.titanium.ui.widget.TiUIImageView.processProperties(TiUIImageView.java:861)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.kroll.KrollProxy.setModelListener(KrollProxy.java:737)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.realizeViews(TiViewProxy.java:530)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleGetView(TiViewProxy.java:522)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.getOrCreateView(TiViewProxy.java:500)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleAdd(TiViewProxy.java:616)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:307)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat org.appcelerator.titanium.proxy.TiWindowProxy.handleMessage(TiWindowProxy.java:110)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat ti.modules.titanium.ui.ActivityWindowProxy.handleMessage(ActivityWindowProxy.java:93)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat android.os.Looper.loop(Looper.java:143)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat android.app.ActivityThread.main(ActivityThread.java:4701)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat java.lang.reflect.Method.invoke(Method.java:521)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\n04-04 16:24:06.900 21034 21034 E TiDrawableReference: \tat dalvik.system.NativeStart.main(Native Method)\r\n04-04 16:24:06.916 1401 1428 D MediaProvider: current image thumbnail number created successfully is:1\r\n04-04 16:24:06.916 21034 21034 W TiDrawableReference: (main) [47,524626] Bitmap final bounds could not be determined. If bitmap is loaded, it won't be scaled.\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: when imageview width or height are set to 0 or invalid, no bitmap scaling occurs", "creator": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "421806", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as this version of KS is no longer supported.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-06-12T19:41:24.000+0000", "updated": "2017-06-12T19:41:24.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }