From acdbfd9ab65432680a540277a9cb1a3d1346e0f0 Mon Sep 17 00:00:00 2001 From: tresabhi <43380238+tresabhi@users.noreply.github.com> Date: Thu, 3 Dec 2026 23:19:14 -0600 Subject: [PATCH] auto crop scratched flags --- .../nations/[nation]/flags/scratched.webp.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/website/src/pages/[...chunk_api]/nations/[nation]/flags/scratched.webp.ts b/packages/website/src/pages/[...chunk_api]/nations/[nation]/flags/scratched.webp.ts index f82108950..4b8d276ff 100644 --- a/packages/website/src/pages/[...chunk_api]/nations/[nation]/flags/scratched.webp.ts +++ b/packages/website/src/pages/[...chunk_api]/nations/[nation]/flags/scratched.webp.ts @@ -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) { + return new Response(await readPackedSprite(props.packed)); }