test image here: http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif
I've tried several solutions found on the internet but there is no working solution.
I'm using the following snippet code:
Url imageUrl = new Url("http://images.plurk.com/tn_4134189_bf54fe8e270ce41240d534b5133884ee.gif");
Bitmap image = BitmapFactory.decodeStream(imageUrl.openStream());
Always getting this log:
DEBUG/skia(1441): --- decoder->decode returned false
Any help? Thanks.
EDIT:
Those images failed to be decoded are also can not be shown on a WebView
. But can see if open in a Browser.
Try this as a temporary workaround:
First add the following class:
Then wrap your original stream with PlurkInputStream:
Let me know if this helps you.
EDIT:
Sorry please try the following version instead:
Note that this is not efficient code nor is this a full/correct solution. It will work for most cases, but not all.
this is due to a bug in the InputStream class in Android. You can find a valid workaround and a description of the bug here http://code.google.com/p/android/issues/detail?id=6066
I tried all the solutions but did not solved my problem. After some tests, the problem of skia decoder failing happened a lot when the internet connection is not stable. For me, forcing to redownload the image solved the problem.
The problem also presented more when the image is of large size.
Using a loop will required me at most 2 retries and the image will be downloaded correctly.