summaryrefslogtreecommitdiffstats
path: root/system/libraries/Image_lib.php
diff options
context:
space:
mode:
authorДмитрий <b1tc0re@inbox.ru>2014-10-19 22:36:55 +0200
committerДмитрий <b1tc0re@inbox.ru>2014-10-19 22:36:55 +0200
commitb23b8fc9aa468021d1260c12696b2b48e6c8a90b (patch)
tree1fd376a5ff4c72b0dea7ee4f5472a6ba3c8c711c /system/libraries/Image_lib.php
parent58743d7492234272d9a0cb14117415b461cd6e8b (diff)
We can preserve transparency for PNG images
Diffstat (limited to 'system/libraries/Image_lib.php')
-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 39753705b..1577887c2 100644
--- a/system/libraries/Image_lib.php
+++ b/system/libraries/Image_lib.php
@@ -1201,6 +1201,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)
{
@@ -1785,4 +1792,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 */