Search code examples
androiduniversal-image-loader

How to get height and width of image with Android Universal Image Loader?


How can I access the height and width of an image loaded using the Android Universal Image Loader?


Solution

  • You can get Bitmap of image when image was loaded using ImageLoadingListener:

    imageLoader.displayImage(imageUrl, imageView, [options], new SimpleImageLoadingListener() {
        @Override
        public void onLoadingComplete(Bitmap loadedImage) {
            int width = loadedImage.getWidth();
            int height = loadedImage.getHeight();
            //...
        }
    });