Fix dependencies

This commit is contained in:
Emma [it/its]@Rory&
2025-04-09 16:18:19 +02:00
committed by Rory&
parent 016c0ff760
commit ebc063df97
3 changed files with 34 additions and 32 deletions

View File

@@ -157,11 +157,11 @@ export async function ImageProxy(req: Request, res: Response) {
const buffer = Buffer.from(arrayBuffer);
if (sharp && sharpSupported.has(contentType)) {
resultBuffer = await sharp
resultBuffer = Buffer.from(await sharp
.default(buffer)
// Sharp doesn't support "scaleToFit"
.resize(width)
.toBuffer();
.toBuffer());
} else if (Jimp && jimpSupported.has(contentType)) {
resultBuffer = await Jimp.read(buffer).then((image) => {
contentType = image.getMIME();
@@ -183,3 +183,5 @@ export async function ImageProxy(req: Request, res: Response) {
res.send(resultBuffer);
}