auto crop scratched flags

This commit is contained in:
tresabhi committed 2026-12-03 23:19:14 -06:00
1 parent 06916fe7be
commit acdbfd9ab6
1 file changed
+7 -5
@@ -1,5 +1,9 @@
import type { APIContext, GetStaticPathsItem } from "astro"; import type { APIContext, GetStaticPathsItem } from "astro";
import { mixStaticPaths } from "../../../../../astro/mixStaticPaths"; import { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
import {
readPackedSprite,
type PackedSpriteProps,
} from "../../../../../core/blitz/readSprite";
import { vfs } from "../../../../../core/blitzkit/vfs"; import { vfs } from "../../../../../core/blitzkit/vfs";
import { getStaticPaths as _getStaticPaths } from "../../../_index"; import { getStaticPaths as _getStaticPaths } from "../../../_index";
@@ -22,15 +26,13 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
paths.push({ paths.push({
params: { nation }, params: { nation },
props: { path }, props: { packed: path },
}); });
} }
return paths; return paths;
}); });
export async function GET({ props }: APIContext<{ path: string }>) { export async function GET({ props }: APIContext<PackedSpriteProps>) {
const bytes = new Uint8Array(await vfs.file(props.path)); return new Response(await readPackedSprite(props.packed));
return new Response(bytes);
} }