检测选择的图片是否破损
作者:
阿蕊儿 | 来源:发表于
2017-07-04 09:53 被阅读22次/**
* 检查图片是否损坏
* @param filePath 图片路径
* @return true 图片破损
*/
public static boolean checkImgDamage(String filePath) {
BitmapFactory.Options options = null;
if (options == null) {
options = new BitmapFactory.Options();
}
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filePath, options);
if (options.mCancel || options.outWidth == -1
|| options.outHeight == -1) {
return true;
}
return false;
}
本文标题:检测选择的图片是否破损
本文链接:https://www.haomeiwen.com/subject/xeuthxtx.html
网友评论