diff --git a/src/utils.ts b/src/utils.ts index 5bf2dd2..5118c78 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -17,8 +17,6 @@ settings.subscribe(b => { const generateThumbnail = async (f: File): Promise => { const can = document.createElement("canvas"); - can.width = 125; - can.height = 125; const [sw, sh] = [125, 125]; const url = URL.createObjectURL(f); @@ -59,7 +57,7 @@ const generateThumbnail = async (f: File): Promise => { ctx.drawImage(source, 0, 0, dims[0], dims[1]); - const blob = await new Promise(_ => can.toBlob(_, "image/jpg")); + const blob = await new Promise(_ => can.toBlob(_)); if (!blob) return Buffer.alloc(0); return Buffer.from(await blob.arrayBuffer());