phalcon/cphalcon · error · Phalcon\Image\Exceptions\TextRenderingFailed

Call to imagettfbbox() failed

Error message

Call to imagettfbbox() failed

What it means

Error "Call to imagettfbbox() failed" thrown in phalcon/cphalcon.

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)

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.