Skip to content

Commit 9923831

Browse files
handle some PNG files when resized (#549)
1 parent e15f5e9 commit 9923831

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/lib/utils/index.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,10 @@ export const getMimetype = async(file: Uint8Array | Buffer, name?: string): Prom
106106
try {
107107
type = await fromBuffer(file);
108108
} catch(e) {
109-
console.warn("An exception occurred while processing the buffer:", e.message);
109+
// A temporary solution for some PNG files when resized
110+
if (!name){
111+
return 'image/png';
112+
}
110113
}
111114

112115
if (name && name.indexOf('.') > -1) {

0 commit comments

Comments
 (0)