Merge pull request #3278 from b1tc0re/patch-1
We can preserve transparency for PNG images
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index a70a7bb..d653b16 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1212,6 +1212,13 @@
imagecopymerge($src_img, $wm_img, $x_axis, $y_axis, 0, 0, $wm_width, $wm_height, $this->wm_opacity);
}
+ // We can preserve transparency for PNG images
+ if ($this->image_type === 3)
+ {
+ imagealphablending($src_img, FALSE);
+ imagesavealpha($src_img, TRUE);
+ }
+
// Output the image
if ($this->dynamic_output === TRUE)
{
@@ -1796,4 +1803,4 @@
}
/* End of file Image_lib.php */
-/* Location: ./system/libraries/Image_lib.php */
\ No newline at end of file
+/* Location: ./system/libraries/Image_lib.php */