diff --git a/deno.json b/deno.json index e59d28f..f314ccf 100644 --- a/deno.json +++ b/deno.json @@ -23,8 +23,8 @@ }, "imports": { "@hono/hono": "jsr:@hono/hono@^4.4.11", - "imagescript": "https://deno.land/x/imagescript@1.3.0/mod.ts", - "jszip": "https://esm.sh/jszip@3.10.1", + "imagescript": "npm:imagescript@1.3.0", //https://deno.land/x/imagescript@1.3.0/mod.ts", + "jszip": "npm:jszip@3.10.1", "nanoid": "npm:nanoid@5.0.7", "nbtify": "npm:nbtify@1.90.1", "classix": "npm:classix@^2.1.38", diff --git a/src/_decode.ts b/src/_decode.ts index 46d7a80..94ffc46 100644 --- a/src/_decode.ts +++ b/src/_decode.ts @@ -76,11 +76,13 @@ export default async function decode( } // Resize every frame above the max width/height - return img!.map((i: Image | GIF) => + const frames = img?.map((i: imagescript.Image | imagescript.Frame) => i.height > MAX_HEIGHT ? i.resize(imagescript.Image.RESIZE_AUTO, MAX_HEIGHT) : i.width > MAX_WIDTH ? i.resize(MAX_WIDTH, imagescript.Image.RESIZE_AUTO) : i - ) as DecodedFrames; + ) ?? []; + + return frames as DecodedFrames; }