I am using PHP ImageMagic and I am trying to put a border around a Rectangle. I am following this, and this to create the border. It seems to be working fine for them, but for me, if I make the stroke width more than 2, it starts to break.
Here is the code, that I am using
$white = new ImagickPixel("rgb(255, 255, 255)");
$borderWidth = 10;
$draw = new ImagickDraw();
$strokeColor = new ImagickPixel("rgb(255, 255, 255)");
$fillColor = new ImagickPixel("none");
$draw->setStrokeColor($strokeColor);
$draw->setFillColor($fillColor);
//$draw->setStrokeOpacity(1);
$draw->setStrokeWidth(2);
$draw->rectangle(5, 5, 295, 295);
$imagick = new Imagick();
$imagick->newImage(300, 300, "rgb(225, 225, 225)");
$imagick->setImageFormat("png");
$imagick->drawImage($draw);
header("Content-type:image/png");
echo $imagick;die;
This is the result, with $draw->setStrokeWidth(2)
And this is the result, with $draw->setStrokeWidth(5)
which obviously seems broken.
What might be the issue?