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 { mixStaticPaths } from "../../../../../astro/mixStaticPaths";
import {
readPackedSprite,
type PackedSpriteProps,
} from "../../../../../core/blitz/readSprite";
import { vfs } from "../../../../../core/blitzkit/vfs";
import { getStaticPaths as _getStaticPaths } from "../../../_index";
@@ -22,15 +26,13 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, async () => {
paths.push({
params: { nation },
props: { path },
props: { packed: path },
});
}
return paths;
});
export async function GET({ props }: APIContext<{ path: string }>) {
const bytes = new Uint8Array(await vfs.file(props.path));
return new Response(bytes);
export async function GET({ props }: APIContext<PackedSpriteProps>) {
return new Response(await readPackedSprite(props.packed));
}