Bug #73272 [NEW]: imagescale() permanently changes interpolation method

From: Date: Sun, 09 Oct 2016 12:12:40 +0000
Subject: Bug #73272 [NEW]: imagescale() permanently changes interpolation method
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-204561@lists.php.net to get a copy of this message
From: cmb Operating system: * PHP version: master-Git-2016-10-09 (Git) Package: GD related Bug Type: Bug Bug description:imagescale() permanently changes interpolation method 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 bug report at https://bugs.php.net/bug.php?id=73272&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=73272&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=73272&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=73272&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=73272&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=73272&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=73272&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=73272&r=needscript Try newer version: https://bugs.php.net/fix.php?id=73272&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=73272&r=support Expected behavior: https://bugs.php.net/fix.php?id=73272&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=73272&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=73272&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=73272&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=73272&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=73272&r=dst IIS Stability: https://bugs.php.net/fix.php?id=73272&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=73272&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=73272&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=73272&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=73272&r=mysqlcfg

« previous php.bugs (#204561) next »