keep PNG transparancy on GDBackend::rotatePixelByPixel

This commit is contained in:
Sander Hagenaars 2017-06-14 15:54:21 +02:00 committed by Daniel Hensby
parent 4f4fb62dfa
commit b61c3ac8c3
No known key found for this signature in database
GPG Key ID: B00D1E9767F0B06E

View File

@ -321,6 +321,7 @@ class GDBackend extends Object implements Image_Backend {
} }
$rotate=imagecreatetruecolor($destWidth,$destHeight); $rotate=imagecreatetruecolor($destWidth,$destHeight);
imagealphablending($rotate, false); imagealphablending($rotate, false);
imagesavealpha($rotate, true); // to maintain PNG transparency
for ($x = 0; $x < ($sourceWidth); $x++) { for ($x = 0; $x < ($sourceWidth); $x++) {
for ($y = 0; $y < ($sourceHeight); $y++) { for ($y = 0; $y < ($sourceHeight); $y++) {
$color = imagecolorat($this->gd, $x, $y); $color = imagecolorat($this->gd, $x, $y);