ID: 48123 User updated by: vincent dot k dot hughitt at nasa dot gov Reported By: vincent dot k dot hughitt at nasa dot gov Status: Bogus Bug Type: GD related Operating System: * PHP Version: 5.2.6-3 Assigned To: pajoye New Comment:
Using true grayscale images as input did the trick. Thank you for the advice pajoye. Keep up the great work! Previous Comments: ------------------------------------------------------------------------ [2009-05-01 12:17:23] paj...@php.net hi, There is no bug, the difference is actually a bug fix in how GD managed PNG Grayscale images. When the grayscale image has an alpha component (PNG_COLOR_TYPE_GRAY_ALPHA), a truecolor image is created. If you use a real grayscale only image the resulting image will still be a palette image. For example: http://pierre.libgd.org/48123_eit_real_grayscale.png is a grayscale only image and works as you expect. It is not a bug, however next version of GD will support grayscale images as internal formats, that will greatly ease this kind of transformation. ------------------------------------------------------------------------ [2009-04-30 19:37:17] vincent dot k dot hughitt at nasa dot gov Okay, got same result on Ubuntu 9.04 using compiled PHP + Bundled GD: PHP 5.2.6-3ubuntu4.1, GD bundled (2.0.34 compatible) ------------------------------------------------------------------------ [2009-04-30 19:12:37] j...@php.net Verified with latest CVS, using bundled GD library. ------------------------------------------------------------------------ [2009-04-30 18:11:51] vincent dot k dot hughitt at nasa dot gov Hi Pajoye, Thanks for the feedback. I did not know that about Ubuntu/Fedora's packaged versions of GD. I will try downloading and compiling PHP from source and see if I run into the same issues, and post my results here. If you start with the images: http://launchpadlibrarian.net/26034594/eit_grayscale.png http://launchpadlibrarian.net/26034597/ctable_eit304.png The expected output of the script is: http://launchpadlibrarian.net/26034598/eit_final_ubuntu810.jpg which is a COLOR image. The problem is that using newer version of PHP, the result is a GRAYSCALE image. ------------------------------------------------------------------------ [2009-04-30 17:33:11] paj...@php.net and what do you expect as "correct" result? for this script. And please not that both Debian and Ubuntu do not use the bundled GD as it is recommended and the GD version they use is in a poor state (ubuntu being less worst). Please try the same using a normal php too, compiling it with the bundled GD. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/48123 -- Edit this bug report at http://bugs.php.net/?id=48123&edit=1