Java tutorial
//package com.java2s; import java.io.InputStream; import android.graphics.BitmapFactory; import android.graphics.BitmapFactory.Options; public class Main { public static int[] measureSize(InputStream is) { final Options options = new Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeStream(is, null, options); return new int[] { options.outWidth, options.outHeight }; } }