Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5391] Android: Image Bitmap Loaded Multiple Times in ImageView

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2011-09-30T15:37:29.000+0000
Affected Version/sRelease 1.7.2
Fix Version/sSprint 2011-39, Release 1.8.0
ComponentsAndroid
Labelsmerged-v8, module_imageview, qe-testadded, stage
ReporterDon Thorp
AssigneeBill Dawson
Created2011-09-29T13:54:16.000+0000
Updated2011-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.

Comments

  1. Bill Dawson 2011-09-29

    Pull request ready https://github.com/appcelerator/titanium_mobile/pull/514
  2. Natalie Huynh 2011-12-06

    Tested with 1.8.0.1.v20111205164258 v8/rhino on Emulator 4.0 and 2.2

JSON Source