This commit is contained in:
Patrick Alvin Alcala 2026-01-30 11:58:22 +08:00
parent ed7f12cac4
commit 8e724b166a
6 changed files with 3 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View file

@ -26,14 +26,14 @@ import { hideBin } from "yargs/helpers";
const avifOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.avif`; const avifOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.avif`;
const webpOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.webp`; const webpOutputPath = `./@dasig/images/${name.toString().split(".").slice(0, -1).join(".")}.webp`;
const avifBuffer = await sharp(`./src/images/${name}`) const avifBuffer = await sharp(`./src/assets/images/${name}`)
.avif({ quality: 60 }) .avif({ quality: 60 })
.resize(size) .resize(size)
.toBuffer(); .toBuffer();
await sharp(avifBuffer).toFile(avifOutputPath); await sharp(avifBuffer).toFile(avifOutputPath);
consola.success(`${name} successfully optimized in Avif`); consola.success(`${name} successfully optimized in Avif`);
const webpBuffer = await sharp(`./src/images/${name}`) const webpBuffer = await sharp(`./src/assets/images/${name}`)
.webp({ quality: 75 }) .webp({ quality: 75 })
.resize(size) .resize(size)
.toBuffer(); .toBuffer();

View file

@ -15,7 +15,7 @@ import { hideBin } from "yargs/helpers";
try { try {
const webpImage = "./@dasig/images/logo.webp"; const webpImage = "./@dasig/images/logo.webp";
const avifImage = "./@dasig/images/logo.avif"; const avifImage = "./@dasig/images/logo.avif";
const inputSrc = "./src/images/logo.png"; const inputSrc = "./src/assets/images/logo.png";
const avifBuffer = await sharp(inputSrc) const avifBuffer = await sharp(inputSrc)
.avif({ quality: 60 }) .avif({ quality: 60 })