mirror of
https://github.com/misskey-dev/media-proxy.git
synced 2025-08-06 16:23:59 +09:00
✌️
This commit is contained in:
1
built/image-processor.js
Normal file
1
built/image-processor.js
Normal file
@ -0,0 +1 @@
|
||||
import sharp from"sharp";export const webpDefault={quality:85,alphaQuality:95,lossless:false,nearLossless:false,smartSubsample:true,mixed:true};export function convertToWebpStream(path,width,height,options=webpDefault){return convertSharpToWebpStream(sharp(path),width,height,options)}export function convertSharpToWebpStream(sharp,width,height,options=webpDefault){const data=sharp.resize(width,height,{fit:"inside",withoutEnlargement:true}).rotate().webp(options);return{data,ext:"webp",type:"image/webp"}}
|
Reference in New Issue
Block a user