4

I'm programming on Android and read images from a remote URL with this call

BitmapFactory.decodeStream( ....

Random, I get the error:

SkImageDecoder::Factory returned null

I read some thread here but not solve my problem (Use a wrapper to InputStream class, use drawable, etc)

Any Idea?

Fernando
  • 99
  • 2
  • 9
  • 6
    Usually you get this error when whatever you're trying to decode as an image isn't actually a valid image. Since you're dealing with remote images, it might very well be some HTML being returned, which obviously can't be decoded into an image. I would add a debug print out of every image (url) you fetch and manually check one that returns above error. Alternatively, route the network traffic through a proxy so you can see what is actually being returned by the server. – MH. Jun 02 '12 at 20:55
  • Did you read this link : http://stackoverflow.com/questions/12006785/android-skimagedecoder-factory-returned-null ? I had the same issue and it solve my problem – Kowlown Jun 24 '13 at 13:18
  • I get this frequently. BitmapFactory cannot decode some JPEG images that can be decoded by others. I wish it could provide a little bit more details about why it is unable to decode it. – Hong Apr 04 '14 at 13:58

1 Answers1

0

I also had this problem... eventually i found out that the image was too big and that caused the error. I suggest you try an image that you know will fit more or less. also you can use the lib picasso:

Picasso.with(context).load("http://i.imgur.com/DvpvklR.png").into(imageView);

But for me even with picasso ive got the error... again because the image was too big.

hope it helps (:

ben
  • 1,064
  • 3
  • 15
  • 29