mirror of
https://github.com/spacebarchat/server.git
synced 2026-10-22 15:22:43 +00:00
Fix style + nix?
This commit is contained in:
1 parent
a987671e4a
commit
c135de9c86
2 files changed
+6
-2
No files matched your search
Generated
BIN
Binary file not shown.
@@ -26,7 +26,7 @@ let sharp: undefined | false | { default: typeof import("sharp") } = undefined;
|
||||
|
||||
let Jimp: JimpType | undefined = undefined;
|
||||
try {
|
||||
Jimp = require("jimp") as JimpType;
|
||||
Jimp = require("jimp") as JimpType;
|
||||
} catch {
|
||||
// empty
|
||||
}
|
||||
@@ -120,7 +120,11 @@ export async function ImageProxy(req: Request, res: Response) {
|
||||
const arrayBuffer = await request.arrayBuffer();
|
||||
let resultBuffer = Buffer.from(arrayBuffer);
|
||||
|
||||
if (!sentImageProxyWarning && resizeSupported.has(contentType) && /^\d+x\d+$/.test(path[1])) {
|
||||
if (
|
||||
!sentImageProxyWarning &&
|
||||
resizeSupported.has(contentType) &&
|
||||
/^\d+x\d+$/.test(path[1])
|
||||
) {
|
||||
if (sharp !== false) {
|
||||
try {
|
||||
sharp = await import("sharp");
|
||||
|
||||
Reference in new issue
Block a user