diff --git a/scripts/face.ts b/scripts/face.ts index 069ffb1..f6d4030 100644 --- a/scripts/face.ts +++ b/scripts/face.ts @@ -6,8 +6,8 @@ const openai = new OpenAI(); const facePath = path.resolve("..", "public/asynctalk-annatarhe.jpg"); -async function createFile(filePath) { - const fileContent = fs.createReadStream(facePath); +async function createFile(filePath: string) { + const fileContent = fs.createReadStream(filePath); const result = await openai.files.create({ file: fileContent, purpose: "vision", diff --git a/scripts/generate-thumbnail.ts b/scripts/generate-thumbnail.ts index 28e22c5..6f38994 100644 --- a/scripts/generate-thumbnail.ts +++ b/scripts/generate-thumbnail.ts @@ -126,6 +126,7 @@ async function main() { { type: "input_image", file_id: hostFaceFileId, + detail: "auto", }, ], }, @@ -145,8 +146,8 @@ async function main() { .filter((output) => output.type === "image_generation_call") .map((output) => output.result); - if (imageData.length > 0) { - const imageBase64 = imageData[0]; + const imageBase64 = imageData[0]; + if (imageBase64) { await writeProcessedImage( Buffer.from(imageBase64, "base64"), outputPath, diff --git a/src/components/OpenGraph/OG.tsx b/src/components/OpenGraph/OG.tsx index 5d6cc14..76e21e6 100644 --- a/src/components/OpenGraph/OG.tsx +++ b/src/components/OpenGraph/OG.tsx @@ -1,6 +1,11 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; + const primaryColor = 'oklch(71.33% 0.112 194.94)' const ratio = 1.5 -const logo = 'https://ik.imagekit.io/annatarhe/asynctalk-logo.png?updatedAt=1716360363124' +const logo = `data:image/png;base64,${readFileSync( + path.resolve("./src/images/logo.png"), +).toString("base64")}` const titleFontSize = 3 * ratio const descriptionFontSize = 1.6 * ratio