You are right to use inJustDecodeBounds. Set to true and be sure to include options in decoding. It just reads the size of the image.
. .
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(<pathName>, options);
int imageHeight = options.outHeight;
int imageWidth = options.outWidth;