OG image generator rendered blank cards for titles containing ampersands
A developer's social-card generator produced solid, text-free 1200x630 images for any title containing an ampersand. The cause was a text-measurement path that treated the raw string as if it had already been HTML-escaped, so sequences like Q&A were read as entity references and drawn as empty text. The failure was silent, with no exception or log entry, and the image still returned a successful response. The fix was to escape input before layout and drawing, and to add a guard that refuses to render when measured text width is zero. The developer concludes that monitoring for image generators should check actual pixel content rather than relying on HTTP status codes alone.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in