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])], // 添加更多的文件类型和特征