From ea7b69f4e6030974b829d1adb8aa74bd9dd6687c Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Wed, 7 May 2025 23:43:50 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Chore:=20tweak=20processUsers.js?= =?UTF-8?q?=20to=20reduce=20feature=20image=20size=20(#980)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While we can't rewrite history, we can at least slow its growth. WebP with lower quality settings gives about 2x size reduction with acceptable visual results. --- processUsers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/processUsers.js b/processUsers.js index 8f8ef7ed..24972e94 100644 --- a/processUsers.js +++ b/processUsers.js @@ -140,7 +140,7 @@ puppeteer fs.writeFileSync(dir + '/index.' + targetLangs[j] + '.md', content); } await page.goto(users[i].url); - await page.screenshot({ path: dir + "/feature.jpg" }); + await page.screenshot({ path: dir + "/feature.jpg", type: 'webp', quality: 50, }); } }