From 79bf98387aefa523f58d742456b1f6df9d146078 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Tue, 31 Mar 2026 21:00:38 +0200 Subject: [PATCH] debug resvg cli --- lib/og.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/og.js b/lib/og.js index 69144e7..ee1d77b 100644 --- a/lib/og.js +++ b/lib/og.js @@ -76,9 +76,21 @@ function loadFonts() { "@fontsource", "inter", "files", - ); + const result = spawnSync('resvg', ['-o', outPath, '-'], { + input: svg, + encoding: null, + timeout: 10000 // 10 seconds + }); return [ { + // Write SVG to temp file for manual debugging + const tmpSvgPath = outPath.replace(/\.png$/, '.svg'); + try { + require('fs').writeFileSync(tmpSvgPath, svg); + console.error(`[og] SVG written to ${tmpSvgPath} for manual testing.`); + } catch (e) { + console.error(`[og] Failed to write SVG for debugging:`, e); + } name: "Inter", data: readFileSync(join(fontsDir, "inter-latin-400-normal.woff")), weight: 400,