Skip to content

Commit

Permalink
-
Browse files Browse the repository at this point in the history
  • Loading branch information
timonson committed Aug 20, 2023
1 parent c2c624b commit 8b82bc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions og_image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ function drawBackground(
}

function isImageFormat(format: string): format is ImageFormat {
console.log(imageFormats, format);
return imageFormats.includes(format as ImageFormat);
}

Expand Down Expand Up @@ -66,6 +67,7 @@ export async function createOgImage(request: Request): Promise<Uint8Array> {
let imageWidth = parseInt(url.searchParams.get("width") || "0");
let imageHeight = parseInt(url.searchParams.get("height") || "0");
const imageFormat = parsedPathname.ext.slice(1);
console.log(parsedPathname, imageFormat, isImageFormat(imageFormat));
if (isImageFormat(imageFormat)) {
if (theme === "light" || theme === "dark") {
drawBackground(ctx, canvasSize, theme);
Expand Down

0 comments on commit 8b82bc8

Please sign in to comment.