Pravin Fofariya
Pravin Fofariya

Reputation: 346

Android how to get image width and height from URL?

I want to get the width and height from the API URL without download the image.

Upvotes: 0

Views: 597

Answers (1)

Code Learner.
Code Learner.

Reputation: 61

Glide.with(getContext().getApplicationContext())
 .asBitmap()
 .load(path)
 .into(new SimpleTarget<Bitmap>() {
     @Override
     public void onResourceReady(Bitmap bitmap,
                                 Transition<? super Bitmap> transition) {
         int w = bitmap.getWidth();
         int h = bitmap.getHeight()
        // mImageView.setImageBitmap(bitmap);
     }
 });

Upvotes: 3

Related Questions