Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
530e1a3d5d
commit
195069450f
480 files changed
+15507
-24650
No files matched your search
@@ -6,10 +6,10 @@
|
||||
* 浏览器拿到的 content-type 才对得上。
|
||||
*/
|
||||
const SIGNATURES: [extension: string, bytes: number[]][] = [
|
||||
[".png", [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]],
|
||||
[".jpg", [0xff, 0xd8, 0xff]],
|
||||
[".gif", [0x47, 0x49, 0x46, 0x38]], // GIF8(GIF87a / GIF89a)
|
||||
[".bmp", [0x42, 0x4d]], // BM
|
||||
['.png', [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]],
|
||||
['.jpg', [0xff, 0xd8, 0xff]],
|
||||
['.gif', [0x47, 0x49, 0x46, 0x38]], // GIF8(GIF87a / GIF89a)
|
||||
['.bmp', [0x42, 0x4d]], // BM
|
||||
]
|
||||
|
||||
export async function sniffImageExtension(file: Blob) {
|
||||
|
||||
Reference in new issue
Block a user