Android - skia解码图像错误



我一直在尝试解码图像如下:

            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 BufferedHttpEntity(
                    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);

虽然我得到一个图像,它没有被解码,并抛出这个错误:

09-29 11:27:38.675: DEBUG/skia(14907):——decoder->decode返回false

我在下面处理skia错误的代码:http://code.google.com/p/shelves/source/browse/trunk/Shelves/src/org/curiouscreature/android/shelves/util/ImageUtilities.java

但这并不能解决问题。

有人能帮忙吗?

检查这个bug报告:

http://code.google.com/p/android/issues/detail?id=9064

相关内容

  • 没有找到相关文章

最新更新