0

I used picasso for loading my images from web into the imageView and it works perfectly for images less than 600 kb but anything above that returns a black imageview meaning that image is not loading. Can I take an image of 1mb or more from URL using picasso? If not, what is the best way to accomplish this.

JBJ
  • 288
  • 2
  • 13
  • Have you tried resizing the image? https://futurestud.io/tutorials/picasso-image-resizing-scaling-and-fit – Sudheesh Mohan Feb 16 '17 at 09:59
  • Picasso supports loading large size images of more than in their 2.6.0 snapshot version – rohitanand Feb 16 '17 at 10:00
  • Also check this question http://stackoverflow.com/questions/23740307/load-large-images-with-picasso-and-custom-transform-object – Sudheesh Mohan Feb 16 '17 at 10:02
  • @SudheeshMohan I tried all that already. Its not about height and width its about the SIZE of the image. I can load a 1920x1080 wallpaper given that its below 500 kb or something but I cannot load a high resolution 1mb picture. – JBJ Feb 16 '17 at 10:04
  • http://stackoverflow.com/questions/36861868/how-to-loop-large-bitmaps-smootly-in-android/36862217#36862217 – PEHLAJ Feb 16 '17 at 10:04
  • @SudheeshMohan http://i.imgur.com/EjL9ika.jpg this image for example is 800x800 but its not loading while I am easily able to load 1920x1080 – JBJ Feb 16 '17 at 10:06
  • that depends on your device's capabilities. Possibly your device just can't handle such a large image – Vladyslav Matviienko Feb 16 '17 at 10:09
  • @VladMatvienko My device was totally able to handle the large images and Glide worked flawlessly. – JBJ Feb 16 '17 at 10:12

2 Answers2

2

Try Glide.

 Glide.with(context).load(url).placeholder(R.drawable.placeholder).into(imageView);

OR

Glide.with (context).load (url).asBitmap().into(imageView);
PEHLAJ
  • 9,980
  • 9
  • 41
  • 53
2

u want to use picasso try this

 Picasso.with(context)
                .load(foodItem.getImageUrl())
                .memoryPolicy(MemoryPolicy.NO_CACHE )
                .networkPolicy(NetworkPolicy.NO_CACHE)
                .error(R.drawable.logosign)
                .noFade()
                .into(holder.productImage);

  compile 'com.squareup.picasso:picasso:2.5.2'