mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-05 17:37:59 +08:00
add webp support
This commit is contained in:
parent
84711ad790
commit
dd0fac8889
@ -3,12 +3,13 @@
|
||||
|
||||
-------------------------------------------------------------------------------------------------------------
|
||||
|
||||
# 5.8.3.M1 (2022-06-08)
|
||||
# 5.8.3.M1 (2022-06-09)
|
||||
|
||||
### 🐣新特性
|
||||
* 【extra 】 mail增加writeTimeout参数支持(issue#2355@Github)
|
||||
* 【core 】 FileTypeUtil增加pptx扩展名支持(issue#I5A0GO@Gitee)
|
||||
* 【core 】 IterUtil.get增加判空(issue#I5B12A@Gitee)
|
||||
* 【core 】 FileTypeUtil增加webp类型判断(issue#I5BGTF@Gitee)
|
||||
### 🐞Bug修复
|
||||
* 【core 】 修复NumberUtil.isXXX空判断错误(issue#2356@Github)
|
||||
* 【core 】 修复Convert.toSBC空指针问题(issue#I5APKK@Gitee)
|
||||
|
@ -83,6 +83,8 @@ public class FileTypeUtil {
|
||||
FILE_TYPE_MAP.put("AC9EBD8F", "qdf"); // Quicken (qdf)
|
||||
FILE_TYPE_MAP.put("E3828596", "pwl"); // Windows Password (pwl)
|
||||
FILE_TYPE_MAP.put("2E7261FD", "ram"); // Real Audio (ram)
|
||||
// https://stackoverflow.com/questions/45321665/magic-number-for-google-image-format
|
||||
FILE_TYPE_MAP.put("52494646", "webp");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -75,4 +75,14 @@ public class FileTypeUtilTest {
|
||||
inputStream.reset();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore
|
||||
public void webpTest(){
|
||||
// https://gitee.com/dromara/hutool/issues/I5BGTF
|
||||
final File file = FileUtil.file("d:/test/a.webp");
|
||||
final BufferedInputStream inputStream = FileUtil.getInputStream(file);
|
||||
final String type = FileTypeUtil.getType(inputStream);
|
||||
Console.log(type);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -17,14 +17,6 @@ public class JavaInfo implements Serializable {
|
||||
private final String JAVA_VENDOR = SystemUtil.get("java.vendor", false);
|
||||
private final String JAVA_VENDOR_URL = SystemUtil.get("java.vendor.url", false);
|
||||
|
||||
// 1.1--1.3能否识别?
|
||||
private final boolean IS_JAVA_1_1 = getJavaVersionMatches("1.1");
|
||||
private final boolean IS_JAVA_1_2 = getJavaVersionMatches("1.2");
|
||||
private final boolean IS_JAVA_1_3 = getJavaVersionMatches("1.3");
|
||||
private final boolean IS_JAVA_1_4 = getJavaVersionMatches("1.4");
|
||||
private final boolean IS_JAVA_1_5 = getJavaVersionMatches("1.5");
|
||||
private final boolean IS_JAVA_1_6 = getJavaVersionMatches("1.6");
|
||||
private final boolean IS_JAVA_1_7 = getJavaVersionMatches("1.7");
|
||||
private final boolean IS_JAVA_1_8 = getJavaVersionMatches("1.8");
|
||||
private final boolean IS_JAVA_9 = getJavaVersionMatches("9");
|
||||
private final boolean IS_JAVA_10 = getJavaVersionMatches("10");
|
||||
@ -161,8 +153,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.1,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_1() {
|
||||
return IS_JAVA_1_1;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -173,8 +166,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.2,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_2() {
|
||||
return IS_JAVA_1_2;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,8 +179,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.3,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_3() {
|
||||
return IS_JAVA_1_3;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -197,8 +192,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.4,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_4() {
|
||||
return IS_JAVA_1_4;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -209,8 +205,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.5,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_5() {
|
||||
return IS_JAVA_1_5;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -221,8 +218,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.6,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_6() {
|
||||
return IS_JAVA_1_6;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -233,8 +231,9 @@ public class JavaInfo implements Serializable {
|
||||
*
|
||||
* @return 如果当前Java版本为1.7,则返回{@code true}
|
||||
*/
|
||||
@Deprecated
|
||||
public final boolean isJava1_7() {
|
||||
return IS_JAVA_1_7;
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user