mirror of
https://github.com/misskey-dev/media-proxy.git
synced 2025-08-07 16:53:56 +09:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
d86823e32d | |||
405e6a5adb |
@ -1,11 +1,12 @@
|
||||
import sharp from 'sharp';
|
||||
export const webpDefault = {
|
||||
quality: 85,
|
||||
quality: 77,
|
||||
alphaQuality: 95,
|
||||
lossless: false,
|
||||
nearLossless: false,
|
||||
smartSubsample: true,
|
||||
mixed: true,
|
||||
effort: 2,
|
||||
};
|
||||
export function convertToWebpStream(path, width, height, options = webpDefault) {
|
||||
return convertSharpToWebpStream(sharp(path), width, height, options);
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "misskey-media-proxy",
|
||||
"version": "0.0.17",
|
||||
"version": "0.0.18",
|
||||
"description": "The Media Proxy for Misskey",
|
||||
"main": "built/index.js",
|
||||
"packageManager": "pnpm@7.28.0",
|
||||
|
@ -16,12 +16,13 @@ export type IImageStream = {
|
||||
export type IImageStreamable = IImage | IImageStream;
|
||||
|
||||
export const webpDefault: sharp.WebpOptions = {
|
||||
quality: 85,
|
||||
quality: 77,
|
||||
alphaQuality: 95,
|
||||
lossless: false,
|
||||
nearLossless: false,
|
||||
smartSubsample: true,
|
||||
mixed: true,
|
||||
effort: 2,
|
||||
};
|
||||
|
||||
export function convertToWebpStream(path: string, width: number, height: number, options: sharp.WebpOptions = webpDefault): IImageStream {
|
||||
|
Reference in New Issue
Block a user