Format all files on BE with perttier config

This commit is contained in:
Alex Holliday committed 2024-10-17 12:07:30 +08:00
1 parent d8e2b06eca
commit fd2d16cf78
60 files changed
+8357 -8367

No files matched your search

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