imagick icon indicating copy to clipboard operation
imagick copied to clipboard

annotateImage rotation not working with antialias off

Open lolcatww opened this issue 3 years ago • 1 comments

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

lolcatww avatar Jan 01 '22 22:01 lolcatww

First,

"waveringness bloodthirsty";

..... you okay there Lolcatww ?

Second, I can reproduce on the ImageMagick command line, so have opened an issue upstream.

Danack avatar Jan 02 '22 03:01 Danack