Glide.with(this)
.load(imgUrl)
.asBitmap()
.listener(new RequestListener<String, Bitmap>() {
@Override
public boolean onException(Exception e, String model, Target<Bitmap> target, boolean isFirstResource) {
Log.d(TAG, "onException " + e.toString());
return false;
}
@Override
public boolean onResourceReady(Bitmap bitmap, String model, Target<Bitmap> target, boolean isFromMemoryCache, boolean isFirstResource) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Log.d(TAG, "width2 " + width);
Log.d(TAG, "height2 " + height);
return false;
}
}).into(mIv_img);
Glide.with(this)
.load(imgUrl)
.asBitmap()
.into(new SimpleTarget<Bitmap>() {
@Override
public void onResourceReady(Bitmap bitmap, GlideAnimation<? super Bitmap> glideAnimation) {
int width = bitmap.getWidth();
int height = bitmap.getHeight();
Log.d(TAG, "width " + width);
Log.d(TAG, "height " + height);
}
});