Java tutorial
//package com.java2s; //License from project: Open Source License import android.graphics.BitmapFactory; public class Main { public static int[] decodeImageSize(String filePath) { BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; options.inDither = false; BitmapFactory.decodeFile(filePath, options); return new int[] { options.outWidth, options.outHeight }; } }