fix png detection

This commit is contained in:
dwelle
2025-09-25 13:39:39 +02:00
parent e6f602e4af
commit 70006555b8

View File

@@ -437,7 +437,7 @@ const getActualMimeTypeFromImage = (buffer: ArrayBuffer) => {
webp: /^82 73 70 70 \d+ \d+ \d+ \d+ 87 69 66 80 86 80 56/, webp: /^82 73 70 70 \d+ \d+ \d+ \d+ 87 69 66 80 86 80 56/,
}; };
if (leadingBytes === bytes.png) { if (leadingBytes.startsWith(bytes.png)) {
mimeType = MIME_TYPES.png; mimeType = MIME_TYPES.png;
} else if (leadingBytes.startsWith(bytes.jpg)) { } else if (leadingBytes.startsWith(bytes.jpg)) {
mimeType = MIME_TYPES.jpg; mimeType = MIME_TYPES.jpg;