Skip to content

Commit

Permalink
Fix style + nix?
Browse files Browse the repository at this point in the history
  • Loading branch information
DEVTomatoCake committed Jun 28, 2024
1 parent a987671 commit c135de9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/api/middlewares/ImageProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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");
Expand Down

0 comments on commit c135de9

Please sign in to comment.