imagick
imagick copied to clipboard
annotateImage rotation not working with antialias off
The following code:
<?php
$str = "waveringness bloodthirsty";
$img = new Imagick();
$img->newImage(500, 200, new ImagickPixel("#1d2021"));
$img->setImageFormat("png");
$draw = new ImagickDraw();
//$draw->setTextAntialias(false);
$draw->setFontSize(45);
$draw->setFillColor("#bdae93");
$img->annotateImage(
$draw,
0,
100,
random_int(-10, 10), //rotation
$str
);
header("Content-type: image/png");
echo $img;
?>
Works. That works well, but if you uncomment $draw->setTextAntialias(false);, the rotation doesnt get applied.
Transferred from https://github.com/php/php-src/issues/7868 cause it wasn't at the right place.
Result w/ antialias on: https://imgur.com/mb0o2JG
Result w/ antialias off https://imgur.com/4T2HHJS
PHP Version
PHP 7.4.25 (cli) (built: Oct 23 2021 21:53:50)
Operating System
Debian GNU/Linux 11 (bullseye) x86_64
First,
"waveringness bloodthirsty";
..... you okay there Lolcatww ?
Second, I can reproduce on the ImageMagick command line, so have opened an issue upstream.