This commit is contained in:
tamaina 2023-03-17 13:44:13 +00:00
parent 405e6a5adb
commit d86823e32d

View File

@ -1,11 +1,12 @@
import sharp from 'sharp'; import sharp from 'sharp';
export const webpDefault = { export const webpDefault = {
quality: 85, quality: 77,
alphaQuality: 95, alphaQuality: 95,
lossless: false, lossless: false,
nearLossless: false, nearLossless: false,
smartSubsample: true, smartSubsample: true,
mixed: true, mixed: true,
effort: 2,
}; };
export function convertToWebpStream(path, width, height, options = webpDefault) { export function convertToWebpStream(path, width, height, options = webpDefault) {
return convertSharpToWebpStream(sharp(path), width, height, options); return convertSharpToWebpStream(sharp(path), width, height, options);