Intervention/image · error · ModifierException

Failed to build bezier curve

Error message

Failed to build bezier curve

What it means

Error "Failed to build bezier curve" thrown in Intervention/image.

Source

Thrown at src/Drivers/Imagick/Modifiers/DrawBezierModifier.php:53

        foreach ($image as $frame) {
            $this->draw($frame->native(), $bezierCurve);
        }

        return $image;
    }

    /**
     * @throws InvalidArgumentException
     * @throws ModifierException
     */
    private function bezierCurve(ImagickPixel $backgroundColor, ImagickPixel $borderColor): ImagickDraw
    {
        try {
            $bezierCurve = new ImagickDraw();
            $bezierCurve->setFillColor($backgroundColor);
        } catch (ImagickDrawException $e) {
            throw new ModifierException(
                'Failed to build bezier curve',
                previous: $e,
            );
        }

        if ($this->drawable->hasBorder() && $this->drawable->borderSize() > 0) {
            try {
                $bezierCurve->setStrokeColor($borderColor);
                $bezierCurve->setStrokeWidth($this->drawable->borderSize());
            } catch (ImagickDrawException $e) {
                throw new ModifierException(
                    'Failed to build bezier curve',
                    previous: $e,
                );
            }
        }

        $bezierCurve->pathStart();

View on GitHub (pinned to 5598b9e397)

Solutions

  1. Pass exactly 3 or 4 points to the bezier drawing callable so the curve can be constructed
  2. Ensure every point is an Intervention\Image\Geometry\Point with numeric x and y coordinates
  3. Check the ImagickDraw path functions (pathCurveToQuadraticBezier/pathCurveTo) are available in the installed imagick version

When it happens

Trigger: Thrown at src/Drivers/Imagick/Modifiers/DrawBezierModifier.php:53 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Intervention/image@5598b9e397 (2026-08-23). Data as JSON: /api/errors/d4eda453e18e0cdb. Report an issue: GitHub.