Intervention/image · error · InvalidArgumentException
You must specify either 3 or 4 points to create a bezier cur
Error message
You must specify either 3 or 4 points to create a bezier curve
What it means
Error "You must specify either 3 or 4 points to create a bezier curve" thrown in Intervention/image.
Source
Thrown at src/Drivers/Imagick/Modifiers/DrawBezierModifier.php:92
$this->drawable->first()->y(),
);
match ($this->drawable->count()) {
3 => $bezierCurve->pathCurveToQuadraticBezierAbsolute(
$this->drawable->second()->x(),
$this->drawable->second()->y(),
$this->drawable->last()->x(),
$this->drawable->last()->y(),
),
4 => $bezierCurve->pathCurveToAbsolute(
$this->drawable->second()->x(),
$this->drawable->second()->y(),
$this->drawable->third()->x(),
$this->drawable->third()->y(),
$this->drawable->last()->x(),
$this->drawable->last()->y(),
),
default => throw new InvalidArgumentException(
'You must specify either 3 or 4 points to create a bezier curve',
),
};
$bezierCurve->pathFinish();
return $bezierCurve;
}
}
View on GitHub (pinned to 5598b9e397)
Solutions
- Provide either 3 points (quadratic bezier) or 4 points (cubic bezier) in the points array
- Build the points array with instances of Intervention\Image\Geometry\Point, e.g. new Point(0, 0)
- Remove any null or non-point entries from the points array before calling the modifier
When it happens
Trigger: Thrown at src/Drivers/Imagick/Modifiers/DrawBezierModifier.php:92 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/6b89bb4165f72bd5.
Report an issue: GitHub.