summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2015-01-12 12:42:28 +0100
committerAndrey Andreev <narf@devilix.net>2015-01-12 12:42:28 +0100
commit010c33fb6b6734fddb7143eee14153080a2b8799 (patch)
treeb3a70a9945065f3bba83dbfaa5fba1fb066fad82 /system/libraries
parentdbf3460bc7c94bf49db7dff3525906cae53a81ac (diff)
parentb23b8fc9aa468021d1260c12696b2b48e6c8a90b (diff)
Merge pull request #3278 from b1tc0re/patch-1
We can preserve transparency for PNG images
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Image_lib.php9
1 files changed, 8 insertions, 1 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php
index a70a7bb6f..d653b1640 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1212,6 +1212,13 @@ class CI_Image_lib {
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 @@ class CI_Image_lib {
}
/* End of file Image_lib.php */
-/* Location: ./system/libraries/Image_lib.php */ \ No newline at end of file
+/* Location: ./system/libraries/Image_lib.php */