Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19601] Android: bitmap size exceeds 32bits when imageView.toImage()

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionInvalid
Resolution Date2017-05-02T20:23:43.000+0000
Affected Version/sRelease 4.1.1
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, android-4.4, imageView, toImage
ReporterAndrey Tkachenko
AssigneeEric Merriman
Created2015-02-17T09:51:37.000+0000
Updated2017-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.

Comments

  1. Radamantis Torres-Lechuga 2015-03-18

    [~mrahman] Can you please try to replicate with 3.5.0, 3.5.1 and master?
  2. Andrey Tkachenko 2015-03-19

    Simple create Classic app and replace app.js with test code above.
  3. Lee Morris 2017-05-02

    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.

JSON Source