diff options
author | Andrey Andreev <narf@bofh.bg> | 2012-10-05 14:14:30 +0200 |
---|---|---|
committer | Andrey Andreev <narf@bofh.bg> | 2012-10-05 14:14:30 +0200 |
commit | 99ae226607fff411bae3b69475bd1b0e3981d563 (patch) | |
tree | 4ba675b36bc1cebc3495a9a0e901cce77d103bee /system/libraries | |
parent | 241a69be96de350b18d875304eb1e361b710e148 (diff) |
Add PNG transparency support in CI_Image_lib::text_watermark() (originally from pull #1317, partially fixes #1139)
Diffstat (limited to 'system/libraries')
-rw-r--r-- | system/libraries/Image_lib.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/system/libraries/Image_lib.php b/system/libraries/Image_lib.php index 899b995d4..ef4187847 100644 --- a/system/libraries/Image_lib.php +++ b/system/libraries/Image_lib.php @@ -1320,6 +1320,13 @@ class CI_Image_lib { imagestring($src_img, $this->wm_font_size, $x_shad, $y_shad, $this->wm_text, $drp_color); imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color); } + + // We can preserve transparency for PNG images + if ($this->image_type === 3) + { + imagealphablending($src_img, FALSE); + imagesavealpha($src_img, TRUE); + } } // Output the final image |