remove final js

This commit is contained in:
Alex Holliday committed 2026-01-22 21:49:49 +00:00
1 parent ce322a8e28
commit b511cde849
12 files changed
+53 -250

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import sharp from "sharp";
const GenerateAvatarImage = async (file: Express.Multer.File) => {
try {
// Resize to target 64 * 64
let resizedImageBuffer = await sharp(file.buffer)
.resize({
width: 64,
height: 64,
fit: "cover",
})
.toBuffer();
//Get b64 string
const base64Image = resizedImageBuffer.toString("base64");
return base64Image;
} catch (error) {
throw error;
}
};
export { GenerateAvatarImage };