android - BitmapFactory.decodeStream always returns null and skia decoder shows decode returned false -


Test the image here:

I have tried many solutions on the internet but no work Is the solution

I am using the following snippet code:

  url imageUrl = new Url ("http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif"); Bitmap image = bitmapfile. Acedostream (imageUrl.openstream ());  

is always receiving this log:

  Debug / Skia (1441): --- Decoder-> Decode Returns  

Any help? Thank you.

Edit:

Failed to decode images that can not be shown even on WebView . But it can see that the browser is open.

Try it as a temporary solution:

First add the following squares: PlurkInputStream protected in filterInputStream {protected PlurkInputStream (in InputStream) {super (in); } @ Override Public en reads (byte [] buffer, int offset, int calculation) throws IOException {intrate = super.read (buffer, offset, count); For (int i = 2; i & lt; buffer lamp; i ++) {if (buffer [i - 2] == 0x2c & buffer [i - 1] == 0x05 & amp; buffer [i ] = = 0) {buffer [i - 1] = 0; }} Return writ; }}

Then wrap your original stream with PlurkInputStream:

  Bitmap bitmap = BitMapficht. Decodestream (new fluctuation inputstream);  

Edit:

Sorry, instead try the following version: (buffer [i] == 0x2c) {if (buffer [i + 2] ==

 for  (int i = 6; i & lt; buffer.length - 4; i ++) {if (buffer [i] == 0x2c) {if 0 End buffer [i + 1]> gt; 0 and buffer [i + 1] & lt; = 48) {buffer [i + 1] = 0; } If (buffer [i + 4] == 0 and buffer [i + 3] & gt; 0 & amp; buffer [i + 3] & lt; = 48) {buffer [i + 3] = 0; }}}  

Note that this is not a skilled code nor is it a complete / correct solution. This will work for most cases, but not all.


Comments