{"record":{"id":"6149ca13502a634f","repo":"phalcon/cphalcon","slug":"call-to-imagettfbbox-failed","errorCode":null,"errorMessage":"Call to imagettfbbox() failed","messagePattern":"Call to imagettfbbox\\(\\) failed","errorType":"exception","errorClass":"Phalcon\\Image\\Exceptions\\TextRenderingFailed","httpStatus":null,"severity":"error","filePath":"phalcon/Image/Adapter/Gd.zep","lineNumber":783,"sourceCode":"        /** @var GdImage $image */\n        let image = this->image;\n\n        let bottomLeftX = 0;\n        let bottomLeftY = 0;\n        let topRightX   = 0;\n        let topRightY   = 0;\n        let offsetX     = (int) offsetX;\n        let offsetY     = (int) offsetY;\n\n        /** @var int<0, 127> $opacity */\n        let opacity = (int) round(abs((opacity * 127 / 100) - 127));\n\n        if (true !== empty(fontFile)) {\n            /** @var false|image_text_bounds $space */\n            let space = imagettfbbox(size, 0, fontFile, text);\n\n            if (false === space) {\n                throw new TextRenderingFailed();\n            }\n\n            if (true === isset(space[0])) {\n                let bottomLeftX = (int) space[0];\n                let bottomLeftY = (int) space[1];\n                let topRightX   = (int) space[4];\n                let topRightY   = (int) space[5];\n            }\n\n            let width  = abs(topRightX - bottomLeftX) + 10;\n            let height = abs(topRightY - bottomLeftY) + 10;\n\n            if (offsetX < 0) {\n                let offsetX = this->width - width + offsetX;\n            }\n\n            if (offsetY < 0) {\n                let offsetY = this->height - height + offsetY;","sourceCodeStart":765,"sourceCodeEnd":801,"githubUrl":"https://github.com/phalcon/cphalcon/blob/b7419de9cd0a8a3f48441ead84c9f8415d463e25/phalcon/Image/Adapter/Gd.zep#L765-L801","documentation":"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.","triggerScenarios":"Thrown at phalcon/Image/Adapter/Gd.zep:783 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the font file path exists and is a valid TTF readable by the process","Ensure GD was compiled with FreeType support"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b7419de9cd0a8a3f48441ead84c9f8415d463e25","analyzedAt":"2026-08-21T06:21:18.811Z","contentChangedAt":"2026-08-21T06:21:18.811Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}