From a6ed5667ab8e17bd7a20dc54def9fd0b9f4dc6b9 Mon Sep 17 00:00:00 2001
From: oo0oo <1148059382@qq.com>
Date: 星期二, 01 二月 2022 10:24:49 +0800
Subject: [PATCH] update .gitignore. 添加JRebel工具rebel.xml文件规则至gitignore
---
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
index 65be65b..25f5306 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileTypeUtils.java
@@ -44,4 +44,33 @@
}
return fileName.substring(separatorIndex + 1).toLowerCase();
}
+
+ /**
+ * 鑾峰彇鏂囦欢绫诲瀷
+ *
+ * @param photoByte 鏂囦欢瀛楄妭鐮�
+ * @return 鍚庣紑锛堜笉鍚�".")
+ */
+ public static String getFileExtendName(byte[] photoByte)
+ {
+ String strFileExtendName = "JPG";
+ if ((photoByte[0] == 71) && (photoByte[1] == 73) && (photoByte[2] == 70) && (photoByte[3] == 56)
+ && ((photoByte[4] == 55) || (photoByte[4] == 57)) && (photoByte[5] == 97))
+ {
+ strFileExtendName = "GIF";
+ }
+ else if ((photoByte[6] == 74) && (photoByte[7] == 70) && (photoByte[8] == 73) && (photoByte[9] == 70))
+ {
+ strFileExtendName = "JPG";
+ }
+ else if ((photoByte[0] == 66) && (photoByte[1] == 77))
+ {
+ strFileExtendName = "BMP";
+ }
+ else if ((photoByte[1] == 80) && (photoByte[2] == 78) && (photoByte[3] == 71))
+ {
+ strFileExtendName = "PNG";
+ }
+ return strFileExtendName;
+ }
}
\ No newline at end of file
--
Gitblit v1.9.3