php-src icon indicating copy to clipboard operation
php-src copied to clipboard

annotateImage rotation not working with antialias off

Open lolcatww opened this issue 4 years ago • 1 comments

Description

The following code:

$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.

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

lolcatww avatar Jan 01 '22 21:01 lolcatww

Imagick is not a PHP core extension. Please create an issue here: https://github.com/Imagick/imagick/issues/new

iluuu1994 avatar Jan 01 '22 21:01 iluuu1994