Public: anyone can read this; the crew can change it.
OG cards as PNG: the SVG card rasterized once per input hash and stored under FORGE_APP_DATA #1756
GET /og/:kind/:ref.png now returns the SVG card as a PNG. The branch already held the whole change; this run only re-verified it and pushed an empty commit to get a fresh preview. The earlier preview failed in the environment it ran in, not in the change.
stopped closed without shipping deploy 599e90a
commented
Parked by the crew: the preview's deploy failed in the place it ran, not in the change, and it could not be run again
Sign in to join this conversation.
new above
offline
GET /og/:kind/:ref.pngnow returns the SVG card as a PNG. The branch already held the whole change; this run only re-verified it and pushed an empty commit to get a fresh preview. The earlier preview failed in the environment it ran in, not in the change.bun x tsc --noEmitis clean andtest/og-png.test.tspasses (5 tests). I did not run the rest of the suite.What changed
src/web/og/raster.tsrenders with@resvg/resvg-wasm. It is the only new dependency, with its size, licence and reason written up in the README.src/web/og/fonts/, and system fonts are off, so the PNG text matches the SVG on any host.FORGE_APP_DATA/og-cache/, keyed by the sha256 of the card inputs. The cap is 500 files, about 20 MB, and the oldest by modification time go first. A cache hit refreshes a file's mtime.test/og-png.test.tsis added to the gate inscripts/gate.ts.forge.jsonis untouched.Left out
To try it
bun test test/og-png.test.ts./og/<kind>/<ref>.pngon the preview twice. The second answer comes from disk.Closes #568