[TIMOB-5391] Android: Image Bitmap Loaded Multiple Times in ImageView
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-09-30T15:37:29.000+0000 |
Affected Version/s | Release 1.7.2 |
Fix Version/s | Sprint 2011-39, Release 1.8.0 |
Components | Android |
Labels | merged-v8, module_imageview, qe-testadded, stage |
Reporter | Don Thorp |
Assignee | Bill Dawson |
Created | 2011-09-29T13:54:16.000+0000 |
Updated | 2011-12-06T15:37:13.000+0000 |
Description
While evaluating bitmap allocation, we discovered that bitmaps are fetched and scaled-down twice for each ImageView, which should not be necessary. We are working to fix that in core code.
Reproduce in 1.7.2:
* Create a new app with this app.js:
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title:'Test',
backgroundColor:'#000',
exitOnClose: true
});
win.add(Ti.UI.createImageView({
image: "KS_nav_ui.png"
}));
win.open();
* Launch the app from Ti Studio *to an emulator*.
* In Ti Studio, down at the console view, turn off the two "Show console when..." options.
* Switch to the FastDev Process console.
* When the app loads, you'll notice in the FastDev Process console that KS_nav_ui.png is fetched three times. *It should only be fetched twice* -- once for getting bitmap size in order to calculate a sample size, and once to load the whole thing.
Pull request ready https://github.com/appcelerator/titanium_mobile/pull/514
Tested with 1.8.0.1.v20111205164258 v8/rhino on Emulator 4.0 and 2.2