Adding transparent png support to text watermarks #1317

Closed
wants to merge 3 commits into from

3 participants

@jakemac53

When performing a text watermark previously on a transparent png it would lose its transparency. Now it checks the image type and adds transparency support, following the same practice that is used when resizing images.

@narfbg narfbg commented on the diff Jun 12, 2012
system/libraries/Image_lib.php
@@ -1313,6 +1313,13 @@ public function text_watermark()
imagestring($src_img, $this->wm_font_size, $x_axis, $y_axis, $this->wm_text, $txt_color);
}
}
+
+ // png we can actually preserve transparency
+ if ($this->image_type == 3)
@narfbg
narfbg added a note Jun 12, 2012

== -> === , add a changelog entry and it's all good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@jakemac53

Ok I added a line into there, I assume that was the right place?

@narfbg

Yes, but at the same time you've somehow gone out of sync with the repository. Try this:

git pull git@github.com:EllisLab/CodeIgniter.git develop
@jakemac53

hmm im using github for mac and I don't know how to do that from there lol

@narfbg

Open a terminal window (not sure how it's called on Macs, might be console as well), type cd /path/to/your/github/CodeIgniter/dir and then you should be able to run that command.

@alexbilbie

@jakemac53 would you be able to pull in the latest changes and update line 1318 to read

if ($this->image_type === 3) 

please and we can pull in this change

@narfbg narfbg added a commit that referenced this pull request Oct 5, 2012
@narfbg narfbg Add PNG transparency support in CI_Image_lib::text_watermark() (origi…
…nally from pull #1317, partially fixes #1139)
99ae226
@narfbg narfbg closed this Oct 5, 2012
@nonchip nonchip pushed a commit to nonchip/CodeIgniter that referenced this pull request Jun 29, 2013
@narfbg narfbg Add PNG transparency support in CI_Image_lib::text_watermark() (origi…
…nally from pull #1317, partially fixes #1139)
b5cf0d8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment