From 796646d282632dd505b23fe6edee94b02a94a8b6 Mon Sep 17 00:00:00 2001 From: zenggaofeng Date: Wed, 27 Dec 2023 10:45:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E6=B3=95=E8=AF=86?= =?UTF-8?q?=E5=88=AB=E9=83=A8=E5=88=86svg=E5=9B=BE=E7=89=87=E7=9A=84?= =?UTF-8?q?=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zenggaofeng --- CHANGELOG.md | 1 + .../src/main/ets/components/imageknife/utils/FileTypeUtil.ets | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cd58cb..52c3a33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ## 2.1.2-rc.2 - HSP兼容性优化 - 暴露DetachFromLayout接口 +- 修复无法识别部分svg图片的类型 ## 2.1.2-rc.1 - 修复断网状态下错误展位图不显示 diff --git a/library/src/main/ets/components/imageknife/utils/FileTypeUtil.ets b/library/src/main/ets/components/imageknife/utils/FileTypeUtil.ets index 6558e53..3bb2cfb 100644 --- a/library/src/main/ets/components/imageknife/utils/FileTypeUtil.ets +++ b/library/src/main/ets/components/imageknife/utils/FileTypeUtil.ets @@ -22,7 +22,7 @@ export class FileTypeUtil { 'png': [new Uint8Array([0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A])], 'gif': [new Uint8Array([0x47, 0x49, 0x46, 0x38, 0x39, 0x61])], 'bmp': [new Uint8Array([0x42, 0x4D])], - 'svg': [new Uint8Array([0x3C, 0x3F, 0x78, 0x6D, 0x6C])], + 'svg': [new Uint8Array([0x3C, 0x3F, 0x78, 0x6D, 0x6C]),new Uint8Array([0x3C, 0x73, 0x76, 0x67, 0x20])], 'webp': [new Uint8Array([0x52, 0x49, 0x46, 0x46])], 'tiff': [new Uint8Array([0x49, 0x20, 0x49]), new Uint8Array([0x49, 0x49, 0x2A, 0x00]), new Uint8Array([0x4D, 0x4D, 0x00, 0x2A]), new Uint8Array([0x4D, 0x4D, 0x00, 0x2B])], // 添加更多的文件类型和特征