Bug #73272 [Asn->Csd]: imagescale() is not affected by, but affects imagesetinterpolation()

From: Date: Sun, 09 Oct 2016 13:32:30 +0000
Subject: Bug #73272 [Asn->Csd]: imagescale() is not affected by, but affects imagesetinterpolation()
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204564@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=73272&edit=1 ID: 73272 Updated by: cmb@php.net Reported by: cmb@php.net Summary: imagescale() is not affected by, but affects imagesetinterpolation() -Status: Assigned +Status: Closed Type: Bug Package: GD related Operating System: * PHP Version: master-Git-2016-10-09 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=b92216b97dcdae738ae24d9bdd1168565dc04406 Log: Fix #73272: imagescale() affects imagesetinterpolation() Previous Comments: ------------------------------------------------------------------------ [2016-10-09 12:36:07] cmb@php.net > We fix the documentation part of this bug, namely that > imagesetinterpolation() would affect imagescale() what has never > been the case. Well, actually it has been the case before PHP 5.5.11 due to bug #66893. ------------------------------------------------------------------------ [2016-10-09 12:30:00] cmb@php.net Automatic comment from SVN on behalf of cmb Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=340408 Log: Fix #73272: imagescale() is not affected by, but affects imagesetinterpolation() We fix the documentation part of this bug, namely that imagesetinterpolation() would affect imagescale() what has never been the case. ------------------------------------------------------------------------ [2016-10-09 12:12:38] cmb@php.net Description: ------------ I've noticed that imagescale() permanently changes the interpolation method, and does not use the interpolation method specified with imagesetinterpolation(). The latter might be a documentation issue; the imagesetinterpolation() manual page states: | Changing the interpolation method affects the following | functions when rendering: | imagescale() The former is a real bug, in my opinion, which appears to have been introduced by fixing bug #66893. Test script: --------------- <?php $src = imagecreatetruecolor(100, 100); imagefilledrectangle($src, 0,0, 99,99, 0xFFFFFF); imageellipse($src, 49,49, 40,40, 0x000000); imagesetinterpolation($src, IMG_NEAREST_NEIGHBOUR); $dst = array(); $dst[] = imagerotate($src, 60, 0xFFFFFF); $dst[] = imagescale($src, 200, 200, IMG_NEAREST_NEIGHBOUR); $dst[] = imagescale($src, 200, 200); $dst[] = imagerotate($src, 60, 0xFFFFFF); foreach ($dst as $i => $im) { imagepng($im, __DIR__ . DIRECTORY_SEPARATOR . "image-$i.png"); } Expected result: ---------------- image-0.png and image-3.png as well as image-1.png and image-2.png should be identical, respectively. Actual result: -------------- All images are different. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=73272&edit=1

« previous php.bugs (#204564) next »