Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

For png images with transparency, the imagesaveaplpha() needs to be s…

…et to true on the source image in order for the alpha to be preserved when using the modifier methods.
  • Loading branch information...
commit 797d526c60865cc8b9ccfaf9454ea4ee83f2e041 1 parent aebbb10
@jmwohl jmwohl authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 filesystem/GD.php
View
7 filesystem/GD.php
@@ -30,7 +30,12 @@ function __construct($filename = null) {
switch($type) {
case 1: if(function_exists('imagecreatefromgif')) $this->setGD(imagecreatefromgif($filename)); break;
case 2: if(function_exists('imagecreatefromjpeg')) $this->setGD(imagecreatefromjpeg($filename)); break;
- case 3: if(function_exists('imagecreatefrompng')) $this->setGD(imagecreatefrompng($filename)); break;
+ case 3: if(function_exists('imagecreatefrompng')) {
+ $img = imagecreatefrompng($filename);
+ imagesavealpha($img, true); // save alphablending setting (important)
+ $this->setGD($img);
+ break;
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.