nanduV / catalano-framework

Automatically exported from code.google.com/p/catalano-framework
0 stars 0 forks source link

Bitmap b in FastBitmap is immutable when FastBitmap is constructed using FastBitmap(Bitmap bitmap) where the bitmap is from an android drawable. #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Do this in an android project:
1. Drawable icon = getResources().getDrawable(R.drawable.ic_launcher);
2. Bitmap bmp = ((BitmapDrawable)icon).getBitmap();
3. FastBitmap fb = new FastBitmap(bmp);
4. bmp = fb.toBitmap();

What is the expected output? What do you see instead?
Line 561 of the Android version of FastBitmap.java (b.setPixels(pixels, 0, 
stride, 0, 0, b.getWidth(), b.getHeight());) throws IllegalStateException.  The 
problem is with line 54 of the same (this.b = bitmap;) - see 
http://stackoverflow.com/questions/6764839/error-with-setpixels.  Change line 
54 from "this.b = bitmap" to "this.b = bitmap.copy(Bitmap.Config.ARGB_8888, 
true)" and the problem goes away.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by BClintH...@gmail.com on 1 Sep 2013 at 1:15

GoogleCodeExporter commented 8 years ago
Versioning info: I'm using Catalano Framework 1.1.  Developing in Eclipse ADT 
Build: v22.0.1-685705 on OS X, and testing on an Android 4.2 based ROM.

Original comment by BClintH...@gmail.com on 1 Sep 2013 at 1:18

GoogleCodeExporter commented 8 years ago
Thank you very much BClintHall, I had not noticed on mutable. Now is fixed. 
I'll released the new version in september with the fixes and news.

Original comment by diego.ca...@live.com on 1 Sep 2013 at 4:07