perf: webp panorama q72 + effort 6 (giảm dung lượng tải)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
tuyenio
2026-06-25 09:05:59 +07:00
parent 5e9e632345
commit 7ac7d86570
27 changed files with 2 additions and 2 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ const BACKUP_DIR = path.join(ROOT, "image-originals");
const LQIP_OUT = path.join(ROOT, "src/app/tours/chua-thai-lac.lqip.ts");
const PANO_WIDTH = 4096;
const PANO_WEBP_QUALITY = 78;
const PANO_WEBP_QUALITY = 72;
const PANO_QUALITY = 80;
const LQIP_WIDTH = 32;
const MODAL_FILES = ["modal-1.png", "modal-2.png"];
@@ -53,7 +53,7 @@ async function optimizePanoramas() {
const webpBuf = await sharp(src)
.rotate()
.resize({ width: PANO_WIDTH, withoutEnlargement: true })
.webp({ quality: PANO_WEBP_QUALITY })
.webp({ quality: PANO_WEBP_QUALITY, effort: 6 })
.toBuffer();
await fs.writeFile(webpDest, webpBuf);