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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user