phalcon/cphalcon · error · Phalcon\Image\Exceptions\TextRenderingFailed
Call to imagettfbbox() failed
Error message
Call to imagettfbbox() failed
What it means
Thrown by the Gd adapter's text-rendering code when imagettfbbox() returns false while measuring text bounds, typically because the font file is missing or unreadable or FreeType support is absent. Verify the font file path and GD FreeType support.
Solutions
- Verify the font file path exists and is a valid TTF readable by the process
- Ensure GD was compiled with FreeType support
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at phalcon/Image/Adapter/Gd.zep:783 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of phalcon/cphalcon@b7419de9cd (2026-08-21).
Data as JSON: /api/errors/6149ca13502a634f.
Report an issue: GitHub.
Appendix: source
Thrown at phalcon/Image/Adapter/Gd.zep:783
/** @var GdImage $image */
let image = this->image;
let bottomLeftX = 0;
let bottomLeftY = 0;
let topRightX = 0;
let topRightY = 0;
let offsetX = (int) offsetX;
let offsetY = (int) offsetY;
/** @var int<0, 127> $opacity */
let opacity = (int) round(abs((opacity * 127 / 100) - 127));
if (true !== empty(fontFile)) {
/** @var false|image_text_bounds $space */
let space = imagettfbbox(size, 0, fontFile, text);
if (false === space) {
throw new TextRenderingFailed();
}
if (true === isset(space[0])) {
let bottomLeftX = (int) space[0];
let bottomLeftY = (int) space[1];
let topRightX = (int) space[4];
let topRightY = (int) space[5];
}
let width = abs(topRightX - bottomLeftX) + 10;
let height = abs(topRightY - bottomLeftY) + 10;
if (offsetX < 0) {
let offsetX = this->width - width + offsetX;
}
if (offsetY < 0) {
let offsetY = this->height - height + offsetY;View on GitHub (pinned to b7419de9cd)