From b23b8fc9aa468021d1260c12696b2b48e6c8a90b Mon Sep 17 00:00:00 2001 From: Дмитрий Date: Mon, 20 Oct 2014 00:36:55 +0400 Subject: We can preserve transparency for PNG images --- system/libraries/Image_lib.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'system/libraries') 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 */ -- cgit v1.2.3-24-g4f1b