From 1c184f2af7c6a11c779b64b936f45f3d4902c199 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Mon, 22 Apr 2024 22:32:32 -0700 Subject: increase max file size --- lib/app.js | 2 +- lib/upload.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/app.js b/lib/app.js index 5019cda3..fee3b8b6 100644 --- a/lib/app.js +++ b/lib/app.js @@ -35,7 +35,7 @@ app.register(fastifyPassport.secureSession()); fastifyPassport.use("jwt", jwtStrategy); -app.register(fastifyMultipart); + app.register(fastifyMultipart, { limits: { fileSize: 10 ** 7}}); app.register(fastifyStatic, { root: path.join("/app/data/uploads"), diff --git a/lib/upload.js b/lib/upload.js index 5a91caa4..0b558acf 100644 --- a/lib/upload.js +++ b/lib/upload.js @@ -45,7 +45,7 @@ export default async (req, res) => { if (format !== "image" && !["jpg", "jpeg", "png"].includes(ext)) fail("unsupported file type"); - let t = sharp().rotate().resize(width).webp(); + let t = sharp({ failOnError: false }).rotate().resize(width).webp(); let processedBuffer = await streamToBuffer(s2.pipe(t)); let hash = crypto -- cgit v1.2.3