Android: Bitmap_NJI - Failed To Create SkBitmap
<p>So I have a function that loads an image using decodeFile - then I am resizing the photo and drawing it into a canvas. This works really well on my Moto Droid 2.2.3 &amp; my Nexus 4.1.1 - but on my HTC 4.0.3 every time the createScaledBitmap fires it crashes and throws the error "Failed To Create SkBitmap"...</p>

<p>here is a sample of the code...</p>

<pre><code>// create image bitmap
            BitmapFactory.Options bmOptions = new BitmapFactory.Options();
            bmOptions.inPurgeable = true;
            bmOptions.inSampleSize = 2;
            Bitmap rawImage = BitmapFactory.decodeFile(imageURL,bmOptions);
            Bitmap bmp = Bitmap.createBitmap(rawImage);

            float ratio = 0;
            int maxHeight = 900;
            int maxWidth = 900;
            float height = bmp.getHeight();
            float width = bmp.getWidth();

            Log.d("HEIGHT",""+height);
            Log.d("WIDTH",""+width);
            int nh = 0;
            int nw = 0;
            // check if current width is larger
            if(width &gt; maxWidth){
                ratio = maxWidth / width;
                float newWidth = maxWidth;
                float newHeight = height*ratio;

                nw = Math.round(newWidth);
                nh = Math.round(newHeight);

                Log.d("NEW RATIO",""+ratio);
                Log.d("NEW HEIGHT",""+newHeight);

                // RESET HEIGHT AND WIDTH
                height = height * ratio;
                width = width * ratio;
            }
            if(height &gt; maxHeight){
                ratio = maxHeight / height;

                float newWidth = width*ratio;
                float newHeight = maxHeight;

                nw = Math.round(newWidth);
                nh = Math.round(newHeight);


                Log.d("NEW RATIO",""+ratio);
                Log.d("NEW HEIGHT",""+newHeight);
                height = height * ratio;
                width = width * ratio;
            }
            bmp = Bitmap.createScaledBitmap(bmp,nw,nh,false);
            Bitmap img = Bitmap.createBitmap(bmp,0,0,655,655);
</code></pre>

<p>Like I said this works fine on my other devices and versions of Android... I tried searching but I cannot seem to find anything that really addresses this issue...</p>

<p>I know it is the createScaledBitmap because if I comment that line out everything works - but my bitmap doesn't scale.</p>
