Bug #55034 [Opn->Nab]: ImageCopyResampled doesn't calculate colours properly with alpha

From: Date: Tue, 19 Jul 2016 16:20:22 +0000
Subject: Bug #55034 [Opn->Nab]: ImageCopyResampled doesn't calculate colours properly with alpha
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-202424@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=55034&edit=1 ID: 55034 Updated by: cmb@php.net Reported by: php at mrphlip dot com Summary: ImageCopyResampled doesn't calculate colours properly with alpha -Status: Open +Status: Not a bug Type: Bug Package: GD related Operating System: Ubuntu Natty PHP Version: 5.3.6 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: This issue has been reported against upstream libgd[1] and will most likely be resolved soon. [1] <https://github.com/libgd/libgd/issues/201> Previous Comments: ------------------------------------------------------------------------ [2012-04-21 16:17:22] php at heavyconsulting dot net After some more research I found a solution that fixed this issue for me. Using instructions found on http://drupal.org/node/878778 i was able to build a new php5-gd deb-package on a new virtual machine I installed with the same version of debian that my server uses. Then I could simply copy the new deb-file to the server and install it. I now have the bundled GD with all the missing functions and it handles alpha/colours correctly when using ImageCopyResampled, so I am now happy. In other words, this is not a bug with PHP. It is a bug with the original shared GD-library, and it has been fixed in the PHP-bundled GD-library, but not all distributions use that version. ------------------------------------------------------------------------ [2012-04-21 12:54:16] php at heavyconsulting dot net I did some more research, and the difference is due to different GD-libraries. The Debian/Ubuntu PHP-packages uses the original GD-library, while CentOS uses PHPs "bundled" GD-library. The original library is missing a lot of fixes and functions that the PHP-variant have. According to some Debian people, we can expect them to use the bundled library sometime around when "hell freezes over", or when the PHP-team pushes their changes and improvements to the main GD-library. So, in other words, this is probably not a bug. ------------------------------------------------------------------------ [2012-04-21 11:59:13] php at heavyconsulting dot net I have this problem on a new server running Debian Squeeze with php5-gd 5.3.3-7+squeeze8. I do not have this problem on my older server running CentOS with php-gd-5.1.6-24.el5_4.5. The test-script produces the expected result on the old CentOS server, and the wrong result on the new Debian server. My application uses imagecopyresampled to rescale and place simple white images with alpha channel on top of a background image. This works great on the old server, but on the new one it results in a black border around the edge of the white graphic. ------------------------------------------------------------------------ [2011-06-13 06:38:18] php at mrphlip dot com Hmm... I've just tried this on a different machine, and it works correctly there. I notice that the two machines link to GD differently... on my machine (where the bug happens), I don't have ImageAntiAlias, but on the other machine (where it works), I do... which I know is related to how GD is compiled. I'm not sure whether this is related, but I figure more information can't hurt. ------------------------------------------------------------------------ [2011-06-11 15:53:31] php at mrphlip dot com Changed summary to be more accurate... it calculates the alpha fine, it's the colours it doesn't calculate correctly in the presence of an alpha channel. ------------------------------------------------------------------------ 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 https://bugs.php.net/bug.php?id=55034 -- Edit this bug report at https://bugs.php.net/bug.php?id=55034&edit=1

« previous php.bugs (#202424) next »