Change Profile picture format to webp

pull/4/head
Trivernis 5 years ago
parent cc100f967b
commit 88f84a42b3

@ -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);

Loading…
Cancel
Save