From 88f84a42b38f78f9b06c50de435331dbb71201a3 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Thu, 9 Jan 2020 16:59:46 +0100 Subject: [PATCH] Change Profile picture format to webp --- src/routes/upload.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/upload.ts b/src/routes/upload.ts index 92a1569..e4a34c3 100644 --- a/src/routes/upload.ts +++ b/src/routes/upload.ts @@ -40,12 +40,12 @@ export class UploadRoute extends Route { if (req.session.userId) { if (profilePic) { try { - const fileBasename = this.getFileName() + ".png"; + const fileBasename = this.getFileName() + ".webp"; const filePath = path.join(this.dataDir, fileBasename); await sharp(profilePic.data) .resize(512, 512) .normalise() - .png() + .webp() .toFile(filePath); fileName = `/${dataDirName}/${fileBasename}`; const user = await User.findByPk(req.session.userId);