[TIMOB-19601] Android: bitmap size exceeds 32bits when imageView.toImage()
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Invalid |
| Resolution Date | 2017-05-02T20:23:43.000+0000 |
| Affected Version/s | Release 4.1.1 |
| Fix Version/s | n/a |
| Components | Android |
| Labels | android, android-4.4, imageView, toImage |
| Reporter | Andrey Tkachenko |
| Assignee | Eric Merriman |
| Created | 2015-02-17T09:51:37.000+0000 |
| Updated | 2017-05-02T20:23:43.000+0000 |
Description
This code causes an exception: "bitmap size exceeds 32bits"
var win = Ti.UI.createWindow();
var savedFile = Titanium.Filesystem.getFile(Titanium.Filesystem.applicationDataDirectory, "myimage.png");
var image = Ti.UI.createImageView({image: "KS_nav_ui.png");
function saveImage(e) {
image.removeEventListener('load', saveImage);
savedFile.write(Ti.UI.createImageView({
image : image.image,
width : 'auto',
height : 'auto'
}).toImage());
}
image.addEventListener('load', saveImage);
win.add(image);
win.open();
This exception observed in Android 4.4.2.
But Android 4.2.2 runs without exception.
It disappears for 4.4.2 by replace toImage to toBlob.
[~mrahman] Can you please try to replicate with 3.5.0, 3.5.1 and master?
Simple create Classic app and replace app.js with test code above.
Resolving ticket as Invalid as there is now a new version of Kitchen Sink available and we no longer support the version which relates to this ticket.