imageKnife支持heic格式图片
Signed-off-by: 18829029633 <18829029633@163.com>
This commit is contained in:
parent
ca53509ebc
commit
6bf0e6f511
|
@ -37,6 +37,16 @@ struct TestImageKnifeOptionChangedPage {
|
||||||
build() {
|
build() {
|
||||||
Scroll() {
|
Scroll() {
|
||||||
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
|
||||||
|
Flex({direction:FlexDirection.Row}){
|
||||||
|
Button('本地heic')
|
||||||
|
.onClick(()=>{
|
||||||
|
this.imageKnifeOption1 = {
|
||||||
|
loadSrc: $r('app.media.yunHeic'),
|
||||||
|
placeholderSrc: $r('app.media.icon_loading'),
|
||||||
|
errorholderSrc: $r('app.media.icon_failed'),
|
||||||
|
};
|
||||||
|
}).margin({left:5}).backgroundColor(Color.Blue)
|
||||||
|
}
|
||||||
Flex({direction:FlexDirection.Row}){
|
Flex({direction:FlexDirection.Row}){
|
||||||
Button('本地jpg')
|
Button('本地jpg')
|
||||||
.onClick(()=>{
|
.onClick(()=>{
|
||||||
|
|
Binary file not shown.
|
@ -26,6 +26,7 @@ export class FileTypeUtil {
|
||||||
'webp': [new Uint8Array([0x52, 0x49, 0x46, 0x46])],
|
'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])],
|
'tiff': [new Uint8Array([0x49, 0x20, 0x49]), new Uint8Array([0x49, 0x49, 0x2A, 0x00]), new Uint8Array([0x4D, 0x4D, 0x00, 0x2A]), new Uint8Array([0x4D, 0x4D, 0x00, 0x2B])],
|
||||||
// 添加更多的文件类型和特征
|
// 添加更多的文件类型和特征
|
||||||
|
'heic': [new Uint8Array([0x00, 0x00, 0x00, 0x18, 0x66, 0x74, 0x79, 0x70, 0x68, 0x65, 0x69, 0x63, 0x00, 0x00, 0x00, 0x00])],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,7 +42,8 @@ export class FileTypeUtil {
|
||||||
value == SupportFormat.webp ||
|
value == SupportFormat.webp ||
|
||||||
value == SupportFormat.bmp ||
|
value == SupportFormat.bmp ||
|
||||||
value == SupportFormat.gif ||
|
value == SupportFormat.gif ||
|
||||||
value == SupportFormat.svg
|
value == SupportFormat.svg ||
|
||||||
|
value == SupportFormat.heic
|
||||||
) {
|
) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -106,5 +108,6 @@ export enum SupportFormat {
|
||||||
bmp = 'bmp',
|
bmp = 'bmp',
|
||||||
gif = 'gif',
|
gif = 'gif',
|
||||||
svg = 'svg',
|
svg = 'svg',
|
||||||
tiff = 'tiff'
|
tiff = 'tiff',
|
||||||
|
heic = 'heic'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue