Kih*_*oon 4 android metadata image
如何从 Android 环境中的图像文件中检索格式(jpeg、bmp、png、..)、宽度、高度等元数据信息?
您可以像这样提取图像的宽度、高度和 MIME 类型:
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);
Run Code Online (Sandbox Code Playgroud)