2 Commits

Author SHA1 Message Date
d86823e32d 0.0.18 2023-03-17 13:44:13 +00:00
405e6a5adb quality, effort変更 2023-03-17 13:43:45 +00:00
3 changed files with 5 additions and 3 deletions

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);

View File

@ -1,6 +1,6 @@
{ {
"name": "misskey-media-proxy", "name": "misskey-media-proxy",
"version": "0.0.17", "version": "0.0.18",
"description": "The Media Proxy for Misskey", "description": "The Media Proxy for Misskey",
"main": "built/index.js", "main": "built/index.js",
"packageManager": "pnpm@7.28.0", "packageManager": "pnpm@7.28.0",

View File

@ -16,12 +16,13 @@ export type IImageStream = {
export type IImageStreamable = IImage | IImageStream; export type IImageStreamable = IImage | IImageStream;
export const webpDefault: sharp.WebpOptions = { export const webpDefault: sharp.WebpOptions = {
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: string, width: number, height: number, options: sharp.WebpOptions = webpDefault): IImageStream { export function convertToWebpStream(path: string, width: number, height: number, options: sharp.WebpOptions = webpDefault): IImageStream {