Update JPEG XL and support container format in mime sniffing. (#969)

This commit is contained in:
Luca Versari
2021-03-10 14:24:52 +01:00
committed by GitHub
parent 7f6ee3204f
commit 0874a3ba52
11 changed files with 8 additions and 7 deletions

View File

@@ -151,6 +151,7 @@ const magicNumberToMimeType = new Map<RegExp, string>([
[/^\xF4\xFF\x6F/, 'image/webp2'],
[/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'],
[/^\xff\x0a/, 'image/jpegxl'],
[/^\x00\x00\x00\x0cJXL \x0d\x0a\x87\x0a/, 'image/jpegxl'],
]);
export async function sniffMimeType(blob: Blob): Promise<string> {