Bug #77943 [Opn->Ver]: imageantialias($image, false); does not work

From: Date: Thu, 25 Apr 2019 12:50:14 +0000
Subject: Bug #77943 [Opn->Ver]: imageantialias($image, false); does not work
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220613@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77943&edit=1 ID: 77943 Updated by: cmb@php.net Reported by: andrew dot moyns at sanofi dot com Summary: imageantialias($image, false); does not work -Status: Open +Status: Verified Type: Bug Package: GD related Operating System: Windows PHP Version: 7.3.4 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: Thanks for reporting. Indeed, this is broken as of PHP 7.2.0[1]. (Not calling imageantialias() would work around the problem for your code.) [1] <http://git.php.net/?p=php-src.git;a=commit;h=d0f14a4429e36d8cb70d14067e79fd252eb4ee7a> Previous Comments: ------------------------------------------------------------------------ [2019-04-25 10:56:23] andrew dot moyns at sanofi dot com Description: ------------ PHP 7.3.4 nts 64bit Unable to turn off antialiasing for an image, resulting in inability to draw lines with thickness > 1 Expected operation is observed in PHP 5.5.38 Test script: --------------- <?php header('Cache-Control: no-cache'); header('Content-type: image/png'); $width = 400; $height = 300; $im = imagecreatetruecolor($width, $height); $white = imagecolorallocate($im, 255, 255, 255); $blue = imagecolorallocate($im, 0, 0, 255); imageantialias($im, false); imagefilledrectangle($im, 0, 0, $width-1, $height-1, $white); imageline($im, 0, 0, $width, $height, $blue); imagesetthickness($im, 3); imageline($im, 10, 0, $width, $height-10, $blue); imagepng($im); ?> Expected result: ---------------- PNG image showing two blue lines, not antialiased, one 1 pixel wide, one 3 pixels wide Actual result: -------------- PNG image showing two blue lines, antialiased, both 1 pixel wide. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77943&edit=1

« previous php.bugs (#220613) next »