Android - skia decode error for images
I have been trying to decode an image as follows:
String dat = jobJect.getString("dat");
client = new DefaultHttpClient();
String url2 = url1 + dat;
request = new HttpGet(url2);
request.setHeader("Cookie", "hcsid=" + GlobalConfig.hcSid);
response = client.execute(request);
BufferedHttpEntity bufHttpEntity = new Buff开发者_开发百科eredHttpEntity(
response.getEntity());
InputStream im = bufHttpEntity.getContent();
OutputStream out = null;
final ByteArrayOutputStream dataStream = new ByteArrayOutputStream();
out = new BufferedOutputStream(dataStream, IO_BUFFER_SIZE);
CameraActivity.copy(im, out);
out.flush();
final byte[] data = dataStream.toByteArray();
mBitMap = BitmapFactory.decodeByteArray(data, 0, data.length);
Although I get an image, it doesn't get decoded and throws this error:
09-29 11:27:38.675: DEBUG/skia(14907): --- decoder->decode returned false
I'm following this code which handles a skia error: http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/util/ImageUtilities.java
But it doesn't solve the issue.
Can anyone please help?
Check this bug report:
http://code.google.com/p/android/issues/detail?id=9064
精彩评论