You can extract the width, height and MIME type of an image as follows:
BitmapFactory.Options opts=new BitmapFactory.Options();
opts.inJustDecodeBounds=true;
BitmapFactory.decodeFile("/sdcard/path/to/imagefile.blah", opts);
Log.i(TAG, "Mimetype:" + opts.outMimeType);
Log.i(TAG, "Width:" + opts.outWidth);
Log.i(TAG, "Height:" + opts.outHeight);
source
share