简体   繁体   中英

Image not loading from a particular resource - used Volley and Picasso

A very peculiar problem seen when loading an image from the following URL: https://codechef_shared.s3.amazonaws.com/sites/default/files/uploads/landing_page_banners/small-banner-updatedcook51.png

However I tried loading images from other sources and they loaded successfully. And there is no error reported! I have used both picasso and volley's network image view for this URL and both are unable to load!

    Picasso.with(context).load("https://codechef_shared.s3.amazonaws.com/sites/default/files/uploads/landing_page_banners/small-banner-updatedcook51.png")
                .resize(200, 200).centerCrop()
                .into(viewHolder.ivEventImage);

Try downgrade image if is of large in size with the method :

ImageView myImgView = (ImageView) findViewById(R.id.imageView);
  Bitmap bMap = BitmapFactory.decodeResource(getResources(), R.drawable.picture);
  Bitmap bMapScaled = Bitmap.createScaledBitmap(bMap, newWidth, newHeight, true);
  myImgView .setImageBitmap(bMapScaled);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM