From: vkary at web dot de Operating system: WinXP & Linux PHP version: 4.3.7 PHP Bug Type: GD related Bug description: imagetruecolortopalette - colors in palette are missing and filled with white
Description: ------------ When trying to reduce a true color image to a palette image with for example 16 or 32 colors, many colors are missing from the palette and filled with white color instead. Reproduce code: --------------- <?php $src_im = imagecreatefromjpeg ("ara.jpg"); imagetruecolortopalette ($src_im, false, 16); Header("Content-type: image/png"); imagepng($src_im); ?> Expected result: ---------------- The color palette should have exactly the number of colors specified in imagetruecolortopalette (16 for example) an the color reduced image should look like this:(created with PHP 4.3.2, GD-Lib 2.0.12) http://www.textilenetwork.de/php/ara16_4_3_2.png The color palette for the image above: http://www.textilenetwork.de/php/ara16_4_3_2_pal.png or for 32 colors: http://www.textilenetwork.de/php/ara32_4_3_2.png http://www.textilenetwork.de/php/ara32_4_3_2_pal.png Actual result: -------------- The images and color palettes with PHP 4.3.6: (& PHP 4.3.7) http://www.textilenetwork.de/php/ara16_4_3_6.png http://www.textilenetwork.de/php/ara16_4_3_6_pal.png http://www.textilenetwork.de/php/ara32_4_3_6.png http://www.textilenetwork.de/php/ara32_4_3_6_pal.png -- Edit bug report at http://bugs.php.net/?id=28949&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28949&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28949&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28949&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28949&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28949&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28949&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28949&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28949&r=support Expected behavior: http://bugs.php.net/fix.php?id=28949&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28949&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28949&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28949&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28949&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28949&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28949&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28949&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28949&r=float