image decoding problem in android
Posted
by achie
on Stack Overflow
See other posts from Stack Overflow
or by achie
Published on 2010-04-29T18:56:39Z
Indexed on
2010/04/29
19:27 UTC
Read the original article
Hit count: 367
Some of the images are not being displayed in the web browser in android while they work fine on all other machines and mobile devices.
this is an example of one of those images http://s3.amazonaws.com/itriage/logos/19/iphone_list.jpg?1261515055
So I tried to pull the image to see it if it works from code. This is what I did
URL url = new URL(address);
InputStream is = (InputStream) url.getContent();
Drawable d = Drawable.createFromStream(is, "src");
It works for most images but for some images including this images it gives this error
D/skia (28314): --- decoder->decode returned false
Why is this happening and how can I prevent this. I saw an example on the developers forum but thats when we are accessing the image directly. But what I want is the browser to handle it. So how do I encode my images on my server for the android devices to recognise them correctly?
© Stack Overflow or respective owner