//获取文件是否是gif图
public static boolean isGifFile(String picturePath) {
if (!TextUtils.isEmpty(picturePath)) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(picturePath, options);
String type = options.outMimeType;//返回image/gif image/jpeg image/png等
int start = type.lastIndexOf(“/”);//截取类型
String format = “”;
if (start < 0) {
format = type;
} else {
format = type.substring(start + 1);
}
return format.equals(“gif”) || format.equals(“GIF”);
}
return false;
}