Skip to content

Commit

Permalink
Fix: wasm-vipsのメモリ使用量に関する問題を改善
Browse files Browse the repository at this point in the history
  • Loading branch information
nexryai committed Feb 3, 2025
1 parent 70d6259 commit 084c0e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/backend/src/services/drive/image-processor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export async function convertToWebp(path: string, width: number, height: number,
return encoded;
}

export async function convertVipsToWebp(image: Image, width: number, height: number, quality = 75): Promise<IImage> {
export async function convertVipsToWebp(image: Image, width: number, height: number, quality = 70): Promise<IImage> {
// Resize
const originalWidth = image.width;
const originalHeight = image.height;
Expand All @@ -71,7 +71,7 @@ export async function convertVipsToWebp(image: Image, width: number, height: num
const resized = image.resize(scale);
image.delete();

const encoded = resized.webpsaveBuffer({
const encoded = resized.writeToBuffer(".webp", {
Q: quality,
lossless: false,
});
Expand Down

0 comments on commit 084c0e3

Please sign in to comment.