Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.BitmapFactory; import java.io.InputStream; public class Main { private static BitmapFactory.Options getImageDimensions(InputStream inputStream) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeStream(inputStream, null, options); return options; } }